Lines Matching full:mac
21 asmlinkage void sm4_ce_cbcmac_update(const u32 *rkey_enc, u8 *mac,
24 u8 *iv, unsigned int nbytes, u8 *mac);
26 u8 *iv, unsigned int nbytes, u8 *mac);
27 asmlinkage void sm4_ce_ccm_final(const u32 *rkey_enc, u8 *iv, u8 *mac);
91 static void ccm_calculate_auth_mac(struct aead_request *req, u8 mac[]) in ccm_calculate_auth_mac() argument
109 sm4_ce_crypt_block(ctx->rkey_enc, mac, mac); in ccm_calculate_auth_mac()
110 crypto_xor(mac, (const u8 *)&aadlen, len); in ccm_calculate_auth_mac()
128 mac, mac); in ccm_calculate_auth_mac()
134 mac, p, nblocks); in ccm_calculate_auth_mac()
145 crypto_xor(mac + len, p, l); in ccm_calculate_auth_mac()
158 u32 *rkey_enc, u8 mac[], in ccm_crypt() argument
161 unsigned int nbytes, u8 *mac)) in ccm_crypt() argument
173 ccm_calculate_auth_mac(req, mac); in ccm_crypt()
180 walk->nbytes - tail, mac); in ccm_crypt()
192 walk->nbytes, mac); in ccm_crypt()
194 sm4_ce_ccm_final(rkey_enc, ctr0, mac); in ccm_crypt()
200 sm4_ce_ccm_final(rkey_enc, ctr0, mac); in ccm_crypt()
212 u8 __aligned(8) mac[SM4_BLOCK_SIZE]; in ccm_encrypt()
216 err = ccm_format_input(mac, req, req->cryptlen); in ccm_encrypt()
224 err = ccm_crypt(req, &walk, ctx->rkey_enc, mac, sm4_ce_ccm_enc); in ccm_encrypt()
229 scatterwalk_map_and_copy(mac, req->dst, req->assoclen + req->cryptlen, in ccm_encrypt()
240 u8 __aligned(8) mac[SM4_BLOCK_SIZE]; in ccm_decrypt()
245 err = ccm_format_input(mac, req, req->cryptlen - authsize); in ccm_decrypt()
253 err = ccm_crypt(req, &walk, ctx->rkey_enc, mac, sm4_ce_ccm_dec); in ccm_decrypt()
262 if (crypto_memneq(authtag, mac, authsize)) in ccm_decrypt()