Changeset View
Changeset View
Standalone View
Standalone View
sys/crypto/aesni/aesni.c
Show First 20 Lines • Show All 849 Lines • ▼ Show 20 Lines | aesni_cipher_mac(struct aesni_session *ses, struct cryptop *crp, | ||||
union { | union { | ||||
struct SHA256Context sha2 __aligned(16); | struct SHA256Context sha2 __aligned(16); | ||||
struct sha1_ctxt sha1 __aligned(16); | struct sha1_ctxt sha1 __aligned(16); | ||||
} sctx; | } sctx; | ||||
uint32_t res[SHA2_256_HASH_LEN / sizeof(uint32_t)]; | uint32_t res[SHA2_256_HASH_LEN / sizeof(uint32_t)]; | ||||
const uint8_t *key; | const uint8_t *key; | ||||
int i, keylen; | int i, keylen; | ||||
if (crp->crp_op & CRYPTO_OP_SKIP_DIGEST) | |||||
return (0); | |||||
if (crp->crp_auth_key != NULL) | if (crp->crp_auth_key != NULL) | ||||
key = crp->crp_auth_key; | key = crp->crp_auth_key; | ||||
else | else | ||||
key = csp->csp_auth_key; | key = csp->csp_auth_key; | ||||
keylen = csp->csp_auth_klen; | keylen = csp->csp_auth_klen; | ||||
if (ses->hmac) { | if (ses->hmac) { | ||||
uint8_t hmac_key[SHA1_BLOCK_LEN] __aligned(16); | uint8_t hmac_key[SHA1_BLOCK_LEN] __aligned(16); | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |