Lines Matching refs:mac
32 asmlinkage void ce_aes_ccm_auth_data(u8 mac[], u8 const in[], u32 abytes,
36 u32 const rk[], u32 rounds, u8 mac[],
40 u32 const rk[], u32 rounds, u8 mac[],
43 asmlinkage void ce_aes_ccm_final(u8 mac[], u8 const ctr[], u32 const rk[],
105 static void ccm_update_mac(struct crypto_aes_ctx *key, u8 mac[], u8 const in[], in ccm_update_mac() argument
110 ce_aes_ccm_auth_data(mac, in, abytes, macp, key->key_enc, in ccm_update_mac()
117 crypto_xor(&mac[*macp], in, added); in ccm_update_mac()
125 aes_encrypt(key, mac, mac); in ccm_update_mac()
126 crypto_xor(mac, in, AES_BLOCK_SIZE); in ccm_update_mac()
133 aes_encrypt(key, mac, mac); in ccm_update_mac()
134 crypto_xor(mac, in, abytes); in ccm_update_mac()
140 static void ccm_calculate_auth_mac(struct aead_request *req, u8 mac[]) in ccm_calculate_auth_mac() argument
159 ccm_update_mac(ctx, mac, (u8 *)<ag, ltag.len, &macp); in ccm_calculate_auth_mac()
171 ccm_update_mac(ctx, mac, p, n, &macp); in ccm_calculate_auth_mac()
180 static int ccm_crypt_fallback(struct skcipher_walk *walk, u8 mac[], u8 iv0[], in ccm_crypt_fallback() argument
206 aes_encrypt(ctx, mac, mac); in ccm_crypt_fallback()
208 crypto_xor(mac, src, bsize); in ccm_crypt_fallback()
211 crypto_xor(mac, dst, bsize); in ccm_crypt_fallback()
222 aes_encrypt(ctx, mac, mac); in ccm_crypt_fallback()
223 crypto_xor(mac, buf, AES_BLOCK_SIZE); in ccm_crypt_fallback()
233 u8 __aligned(8) mac[AES_BLOCK_SIZE]; in ccm_encrypt()
238 err = ccm_init_mac(req, mac, len); in ccm_encrypt()
243 ccm_calculate_auth_mac(req, mac); in ccm_encrypt()
261 num_rounds(ctx), mac, walk.iv); in ccm_encrypt()
268 ce_aes_ccm_final(mac, buf, ctx->key_enc, in ccm_encrypt()
273 err = ccm_crypt_fallback(&walk, mac, buf, ctx, true); in ccm_encrypt()
279 scatterwalk_map_and_copy(mac, req->dst, req->assoclen + req->cryptlen, in ccm_encrypt()
291 u8 __aligned(8) mac[AES_BLOCK_SIZE]; in ccm_decrypt()
296 err = ccm_init_mac(req, mac, len); in ccm_decrypt()
301 ccm_calculate_auth_mac(req, mac); in ccm_decrypt()
319 num_rounds(ctx), mac, walk.iv); in ccm_decrypt()
326 ce_aes_ccm_final(mac, buf, ctx->key_enc, in ccm_decrypt()
331 err = ccm_crypt_fallback(&walk, mac, buf, ctx, false); in ccm_decrypt()
342 if (crypto_memneq(mac, buf, authsize)) in ccm_decrypt()