Changeset View
Changeset View
Standalone View
Standalone View
sys/crypto/aesni/aesni.c
Show First 20 Lines • Show All 554 Lines • ▼ Show 20 Lines | aesni_authprepare(struct aesni_session *ses, int klen) | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
aesni_cipher_setup(struct aesni_session *ses, | aesni_cipher_setup(struct aesni_session *ses, | ||||
const struct crypto_session_params *csp) | const struct crypto_session_params *csp) | ||||
{ | { | ||||
struct fpu_kern_ctx *ctx; | struct fpu_kern_ctx *ctx; | ||||
uint8_t *schedbase; | |||||
int kt, ctxidx, error; | int kt, ctxidx, error; | ||||
schedbase = (uint8_t *)roundup2((uintptr_t)ses->schedules, | |||||
AES_SCHED_ALIGN); | |||||
ses->enc_schedule = schedbase; | |||||
ses->dec_schedule = schedbase + AES_SCHED_LEN; | |||||
ses->xts_schedule = schedbase + AES_SCHED_LEN * 2; | |||||
switch (csp->csp_auth_alg) { | switch (csp->csp_auth_alg) { | ||||
case CRYPTO_SHA1_HMAC: | case CRYPTO_SHA1_HMAC: | ||||
ses->hmac = true; | ses->hmac = true; | ||||
/* FALLTHROUGH */ | /* FALLTHROUGH */ | ||||
case CRYPTO_SHA1: | case CRYPTO_SHA1: | ||||
ses->hash_len = SHA1_HASH_LEN; | ses->hash_len = SHA1_HASH_LEN; | ||||
ses->hash_init = SHA1_Init_fn; | ses->hash_init = SHA1_Init_fn; | ||||
▲ Show 20 Lines • Show All 345 Lines • Show Last 20 Lines |