/Linux-v5.4/include/crypto/ |
D | gcm.h | 13 static inline int crypto_gcm_check_authsize(unsigned int authsize) in crypto_gcm_check_authsize() argument 15 switch (authsize) { in crypto_gcm_check_authsize() 34 static inline int crypto_rfc4106_check_authsize(unsigned int authsize) in crypto_rfc4106_check_authsize() argument 36 switch (authsize) { in crypto_rfc4106_check_authsize()
|
D | aead.h | 133 int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize); 147 unsigned int authsize; member 227 return tfm->authsize; in crypto_aead_authsize() 294 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize);
|
/Linux-v5.4/drivers/crypto/nx/ |
D | nx-aes-ccm.c | 70 unsigned int authsize) in ccm_aes_nx_setauthsize() argument 72 switch (authsize) { in ccm_aes_nx_setauthsize() 89 unsigned int authsize) in ccm4309_aes_nx_setauthsize() argument 91 switch (authsize) { in ccm4309_aes_nx_setauthsize() 133 static int generate_b0(u8 *iv, unsigned int assoclen, unsigned int authsize, in generate_b0() argument 136 unsigned int l, lp, m = authsize; in generate_b0() 159 unsigned int authsize, in generate_pat() argument 211 rc = generate_b0(iv, assoclen, authsize, nbytes, b0); in generate_pat() 336 unsigned int authsize = crypto_aead_authsize(crypto_aead_reqtfm(req)); in ccm_nx_decrypt() local 344 nbytes -= authsize; in ccm_nx_decrypt() [all …]
|
/Linux-v5.4/arch/x86/crypto/ |
D | aegis128-aesni-glue.c | 158 unsigned int authsize) in crypto_aegis128_aesni_setauthsize() argument 160 if (authsize > AEGIS128_MAX_AUTH_SIZE) in crypto_aegis128_aesni_setauthsize() 162 if (authsize < AEGIS128_MIN_AUTH_SIZE) in crypto_aegis128_aesni_setauthsize() 199 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_aesni_encrypt() local 205 req->assoclen + cryptlen, authsize, 1); in crypto_aegis128_aesni_encrypt() 221 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_aesni_decrypt() local 222 unsigned int cryptlen = req->cryptlen - authsize; in crypto_aegis128_aesni_decrypt() 225 req->assoclen + cryptlen, authsize, 0); in crypto_aegis128_aesni_decrypt() 229 return crypto_memneq(tag.bytes, zeros.bytes, authsize) ? -EBADMSG : 0; in crypto_aegis128_aesni_decrypt()
|
/Linux-v5.4/crypto/ |
D | authencesn.c | 50 unsigned int authsize) in crypto_authenc_esn_setauthsize() argument 52 if (authsize > 0 && authsize < 4) in crypto_authenc_esn_setauthsize() 105 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_genicv_tail() local 116 scatterwalk_map_and_copy(hash, dst, assoclen + cryptlen, authsize, 1); in crypto_authenc_esn_genicv_tail() 139 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_genicv() local 145 if (!authsize) in crypto_authenc_esn_genicv() 233 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_decrypt_tail() local 241 unsigned int cryptlen = req->cryptlen - authsize; in crypto_authenc_esn_decrypt_tail() 247 if (!authsize) in crypto_authenc_esn_decrypt_tail() 255 if (crypto_memneq(ihash, ohash, authsize)) in crypto_authenc_esn_decrypt_tail() [all …]
|
D | aead.c | 69 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in crypto_aead_setauthsize() argument 73 if ((!authsize && crypto_aead_maxauthsize(tfm)) || in crypto_aead_setauthsize() 74 authsize > crypto_aead_maxauthsize(tfm)) in crypto_aead_setauthsize() 78 err = crypto_aead_alg(tfm)->setauthsize(tfm, authsize); in crypto_aead_setauthsize() 83 tfm->authsize = authsize; in crypto_aead_setauthsize() 139 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm() 224 unsigned int authsize) in aead_geniv_setauthsize() argument 228 return crypto_aead_setauthsize(ctx->child, authsize); in aead_geniv_setauthsize()
|
D | aegis128-core.c | 384 unsigned int authsize) in crypto_aegis128_setauthsize() argument 386 if (authsize > AEGIS128_MAX_AUTH_SIZE) in crypto_aegis128_setauthsize() 388 if (authsize < AEGIS128_MIN_AUTH_SIZE) in crypto_aegis128_setauthsize() 417 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_encrypt() local 428 authsize, 1); in crypto_aegis128_encrypt() 442 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_decrypt() local 443 unsigned int cryptlen = req->cryptlen - authsize; in crypto_aegis128_decrypt() 446 authsize, 0); in crypto_aegis128_decrypt() 455 return crypto_memneq(tag.bytes, zeros, authsize) ? -EBADMSG : 0; in crypto_aegis128_decrypt()
|
D | gcm.c | 153 unsigned int authsize) in crypto_gcm_setauthsize() argument 155 return crypto_gcm_check_authsize(authsize); in crypto_gcm_setauthsize() 477 unsigned int authsize = crypto_aead_authsize(aead); in crypto_gcm_verify() local 478 unsigned int cryptlen = req->cryptlen - authsize; in crypto_gcm_verify() 482 req->assoclen + cryptlen, authsize, 0); in crypto_gcm_verify() 483 return crypto_memneq(iauth_tag, auth_tag, authsize) ? -EBADMSG : 0; in crypto_gcm_verify() 512 unsigned int authsize = crypto_aead_authsize(aead); in crypto_gcm_decrypt() local 516 cryptlen -= authsize; in crypto_gcm_decrypt() 749 unsigned int authsize) in crypto_rfc4106_setauthsize() argument 754 err = crypto_rfc4106_check_authsize(authsize); in crypto_rfc4106_setauthsize() [all …]
|
D | ccm.c | 117 unsigned int authsize) in crypto_ccm_setauthsize() argument 119 switch (authsize) { in crypto_ccm_setauthsize() 337 unsigned int authsize = crypto_aead_authsize(aead); in crypto_ccm_decrypt_done() local 338 unsigned int cryptlen = req->cryptlen - authsize; in crypto_ccm_decrypt_done() 347 if (!err && crypto_memneq(pctx->auth_tag, pctx->odata, authsize)) in crypto_ccm_decrypt_done() 360 unsigned int authsize = crypto_aead_authsize(aead); in crypto_ccm_decrypt() local 367 cryptlen -= authsize; in crypto_ccm_decrypt() 374 authsize, 0); in crypto_ccm_decrypt() 395 if (crypto_memneq(authtag, odata, authsize)) in crypto_ccm_decrypt() 626 unsigned int authsize) in crypto_rfc4309_setauthsize() argument [all …]
|
D | authenc.c | 250 unsigned int authsize = crypto_aead_authsize(authenc); in crypto_authenc_decrypt_tail() local 251 u8 *ihash = ahreq->result + authsize; in crypto_authenc_decrypt_tail() 254 scatterwalk_map_and_copy(ihash, req->src, ahreq->nbytes, authsize, 0); in crypto_authenc_decrypt_tail() 256 if (crypto_memneq(ihash, ahreq->result, authsize)) in crypto_authenc_decrypt_tail() 269 req->cryptlen - authsize, req->iv); in crypto_authenc_decrypt_tail() 291 unsigned int authsize = crypto_aead_authsize(authenc); in crypto_authenc_decrypt() local 306 req->assoclen + req->cryptlen - authsize); in crypto_authenc_decrypt()
|
/Linux-v5.4/drivers/crypto/cavium/nitrox/ |
D | nitrox_aead.c | 62 unsigned int authsize) in nitrox_aead_setauthsize() argument 69 flags.w0.mac_len = authsize; in nitrox_aead_setauthsize() 72 aead->authsize = authsize; in nitrox_aead_setauthsize() 203 rctx->dstlen = rctx->srclen + aead->authsize; in nitrox_aes_gcm_enc() 231 rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_aes_gcm_dec() 234 rctx->dstlen = rctx->srclen - aead->authsize; in nitrox_aes_gcm_dec() 349 unsigned int authsize) in nitrox_rfc4106_setauthsize() argument 351 switch (authsize) { in nitrox_rfc4106_setauthsize() 360 return nitrox_aead_setauthsize(aead, authsize); in nitrox_rfc4106_setauthsize() 422 aead_rctx->dstlen = aead_rctx->srclen + aead->authsize; in nitrox_rfc4106_enc() [all …]
|
/Linux-v5.4/arch/arm64/crypto/ |
D | aes-ce-ccm-glue.c | 60 static int ccm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in ccm_setauthsize() argument 62 if ((authsize & 1) || authsize < 4) in ccm_setauthsize() 289 unsigned int authsize = crypto_aead_authsize(aead); in ccm_decrypt() local 293 u32 len = req->cryptlen - authsize; in ccm_decrypt() 339 req->assoclen + req->cryptlen - authsize, in ccm_decrypt() 340 authsize, 0); in ccm_decrypt() 342 if (crypto_memneq(mac, buf, authsize)) in ccm_decrypt()
|
D | ghash-ce-glue.c | 321 static int gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in gcm_setauthsize() argument 323 switch (authsize) { in gcm_setauthsize() 542 unsigned int authsize = crypto_aead_authsize(aead); in gcm_decrypt() local 664 gcm_final(req, ctx, dg, tag, req->cryptlen - authsize); in gcm_decrypt() 668 req->assoclen + req->cryptlen - authsize, in gcm_decrypt() 669 authsize, 0); in gcm_decrypt() 671 if (crypto_memneq(tag, buf, authsize)) in gcm_decrypt()
|
/Linux-v5.4/drivers/crypto/caam/ |
D | caamalg_qi.c | 66 unsigned int authsize; member 87 if (!ctx->cdata.keylen || !ctx->authsize) in aead_set_sh_desc() 137 ivsize, ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc() 152 ivsize, ctx->authsize, alg->caam.geniv, in aead_set_sh_desc() 170 ivsize, ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc() 177 static int aead_setauthsize(struct crypto_aead *authenc, unsigned int authsize) in aead_setauthsize() argument 181 ctx->authsize = authsize; in aead_setauthsize() 300 if (!ctx->cdata.keylen || !ctx->authsize) in gcm_set_sh_desc() 316 ctx->authsize, true); in gcm_set_sh_desc() 331 ctx->authsize, true); in gcm_set_sh_desc() [all …]
|
D | caamalg.c | 114 unsigned int authsize; member 140 cnstr_shdsc_aead_null_encap(desc, &ctx->adata, ctx->authsize, in aead_null_set_sh_desc() 159 cnstr_shdsc_aead_null_decap(desc, &ctx->adata, ctx->authsize, in aead_null_set_sh_desc() 183 if (!ctx->authsize) in aead_set_sh_desc() 242 ctx->authsize, is_rfc3686, nonce, ctx1_iv_off, in aead_set_sh_desc() 264 ctx->authsize, alg->caam.geniv, is_rfc3686, in aead_set_sh_desc() 288 ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc() 298 unsigned int authsize) in aead_setauthsize() argument 302 ctx->authsize = authsize; in aead_setauthsize() 317 if (!ctx->cdata.keylen || !ctx->authsize) in gcm_set_sh_desc() [all …]
|
D | caamalg_qi2.c | 82 unsigned int authsize; member 181 if (!ctx->cdata.keylen || !ctx->authsize) in aead_set_sh_desc() 233 ivsize, ctx->authsize, is_rfc3686, in aead_set_sh_desc() 238 ivsize, ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc() 259 ivsize, ctx->authsize, alg->caam.geniv, in aead_set_sh_desc() 270 static int aead_setauthsize(struct crypto_aead *authenc, unsigned int authsize) in aead_setauthsize() argument 274 ctx->authsize = authsize; in aead_setauthsize() 365 unsigned int authsize = ctx->authsize; in aead_edesc_alloc() local 379 dst_len = src_len + (encrypt ? authsize : (-authsize)); in aead_edesc_alloc() 424 (encrypt ? authsize : 0); in aead_edesc_alloc() [all …]
|
/Linux-v5.4/drivers/crypto/ |
D | ixp4xx_crypto.c | 346 int authsize = crypto_aead_authsize(tfm); in finish_scattered_hmac() local 347 int decryptlen = req->assoclen + req->cryptlen - authsize; in finish_scattered_hmac() 351 req->dst, decryptlen, authsize, 1); in finish_scattered_hmac() 654 static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned authsize, in setup_auth() argument 670 cfgword = algo->cfgword | ( authsize << 6); /* (authsize/4) << 8 */ in setup_auth() 982 unsigned authsize = crypto_aead_authsize(tfm); in aead_perform() local 1005 cryptlen = req->cryptlen -authsize; in aead_perform() 1006 eff_cryptlen -= authsize; in aead_perform() 1033 if (lastlen >= authsize) in aead_perform() 1035 buf->buf_len - authsize; in aead_perform() [all …]
|
D | talitos.c | 998 unsigned int authsize = crypto_aead_authsize(aead); in ipsec_esp_unmap() local 999 unsigned int cryptlen = areq->cryptlen - (encrypt ? 0 : authsize); in ipsec_esp_unmap() 1009 cryptlen + authsize, areq->assoclen); in ipsec_esp_unmap() 1052 unsigned int authsize = crypto_aead_authsize(authenc); in ipsec_esp_decrypt_swauth_done() local 1063 icv = oicv - authsize; in ipsec_esp_decrypt_swauth_done() 1065 err = crypto_memneq(oicv, icv, authsize) ? -EBADMSG : 0; in ipsec_esp_decrypt_swauth_done() 1202 unsigned int authsize = crypto_aead_authsize(aead); in ipsec_esp() local 1206 unsigned int cryptlen = areq->cryptlen - (encrypt ? 0 : authsize); in ipsec_esp() 1217 dma_addr_t dma_icv = edesc->dma_link_tbl + edesc->dma_len - authsize; in ipsec_esp() 1254 elen = authsize; in ipsec_esp() [all …]
|
/Linux-v5.4/drivers/crypto/ccree/ |
D | cc_buffer_mgr.c | 576 static bool cc_is_icv_frag(unsigned int sgl_nents, unsigned int authsize, in cc_is_icv_frag() argument 579 return ((sgl_nents > 1) && (last_entry_data_size < authsize)); in cc_is_icv_frag() 712 unsigned int authsize = areq_ctx->req_authsize; in cc_prepare_aead_data_dlli() local 720 offset = *src_last_bytes - authsize; in cc_prepare_aead_data_dlli() 723 offset = *dst_last_bytes - authsize; in cc_prepare_aead_data_dlli() 738 unsigned int authsize = areq_ctx->req_authsize; in cc_prepare_aead_data_mlli() local 750 cc_is_icv_frag(areq_ctx->src.nents, authsize, in cc_prepare_aead_data_mlli() 777 (*src_last_bytes - authsize); in cc_prepare_aead_data_mlli() 779 (*src_last_bytes - authsize); in cc_prepare_aead_data_mlli() 794 cc_is_icv_frag(areq_ctx->src.nents, authsize, in cc_prepare_aead_data_mlli() [all …]
|
D | cc_aead.c | 56 unsigned int authsize; /* Actual (reduced?) size of the MAC/ICv */ member 233 ctx->authsize) != 0) { in cc_aead_complete() 235 ctx->authsize, ctx->cipher_mode); in cc_aead_complete() 248 skip, (skip + ctx->authsize), in cc_aead_complete() 680 unsigned int authsize) in cc_aead_setauthsize() argument 686 if (authsize == 0 || in cc_aead_setauthsize() 687 authsize > crypto_aead_maxauthsize(authenc)) { in cc_aead_setauthsize() 691 ctx->authsize = authsize; in cc_aead_setauthsize() 692 dev_dbg(dev, "authlen=%d\n", ctx->authsize); in cc_aead_setauthsize() 698 unsigned int authsize) in cc_rfc4309_ccm_setauthsize() argument [all …]
|
/Linux-v5.4/drivers/crypto/chelsio/ |
D | chcr_algo.c | 180 int authsize = crypto_aead_authsize(tfm); in chcr_verify_tag() local 187 cmp = crypto_memneq(&fw6_pld->data[2], (fw6_pld + 1), authsize); in chcr_verify_tag() 191 authsize, req->assoclen + in chcr_verify_tag() 192 req->cryptlen - authsize); in chcr_verify_tag() 193 cmp = crypto_memneq(temp, (fw6_pld + 1), authsize); in chcr_verify_tag() 2267 unsigned int authsize = crypto_aead_authsize(tfm); in chcr_aead_common_init() local 2273 if (reqctx->op && req->cryptlen < authsize) in chcr_aead_common_init() 2296 unsigned int authsize = crypto_aead_authsize(crypto_aead_reqtfm(req)); in chcr_aead_need_fallback() local 2298 if (((req->cryptlen - (op_type ? authsize : 0)) == 0) || in chcr_aead_need_fallback() 2337 unsigned int authsize = crypto_aead_authsize(tfm); in create_authenc_wr() local [all …]
|
D | chcr_ipsec.c | 112 int authsize = x->aead->alg_icv_len / 8; in chcr_ipsec_setauthsize() local 114 sa_entry->authsize = authsize; in chcr_ipsec_setauthsize() 116 switch (authsize) { in chcr_ipsec_setauthsize() 617 sa_entry->authsize, in chcr_crypto_wreq() 618 sa_entry->authsize); in chcr_crypto_wreq()
|
/Linux-v5.4/drivers/crypto/ccp/ |
D | ccp-crypto-aes-galois.c | 59 unsigned int authsize) in ccp_aes_gcm_setauthsize() argument 61 switch (authsize) { in ccp_aes_gcm_setauthsize() 120 rctx->cmd.u.aes.authsize = crypto_aead_authsize(tfm); in ccp_aes_gcm_crypt()
|
/Linux-v5.4/drivers/crypto/stm32/ |
D | stm32-cryp.c | 143 size_t authsize; member 465 cryp->areq->cryptlen - cryp->authsize; in stm32_cryp_get_input_text_len() 505 b0[0] |= (8 * ((cryp->authsize - 2) / 2)); in stm32_cryp_ccm_init() 797 unsigned int authsize) in stm32_cryp_aes_gcm_setauthsize() argument 799 return authsize == AES_BLOCK_SIZE ? 0 : -EINVAL; in stm32_cryp_aes_gcm_setauthsize() 803 unsigned int authsize) in stm32_cryp_aes_ccm_setauthsize() argument 805 switch (authsize) { in stm32_cryp_aes_ccm_setauthsize() 968 cryp->authsize = crypto_aead_authsize(crypto_aead_reqtfm(areq)); in stm32_cryp_prepare_req() 972 cryp->total_out = cryp->total_in + cryp->authsize; in stm32_cryp_prepare_req() 975 cryp->total_out = cryp->total_in - cryp->authsize; in stm32_cryp_prepare_req() [all …]
|
/Linux-v5.4/drivers/crypto/mediatek/ |
D | mtk-aes.c | 137 u32 authsize; member 896 info->cmd[cnt++] = AES_GCM_CMD4 | cpu_to_le32(gctx->authsize); in mtk_aes_gcm_info_init() 899 info->cmd[cnt++] = AES_GCM_CMD5 | cpu_to_le32(gctx->authsize); in mtk_aes_gcm_info_init() 900 info->cmd[cnt++] = AES_GCM_CMD6 | cpu_to_le32(gctx->authsize); in mtk_aes_gcm_info_init() 972 aes->total = len + gctx->authsize; in mtk_aes_gcm_start() 974 scatterwalk_map_and_copy(tag, req->dst, len, gctx->authsize, 1); in mtk_aes_gcm_start() 996 gctx->textlen = req->cryptlen - (enc ? 0 : gctx->authsize); in mtk_aes_gcm_crypt() 1085 u32 authsize) in mtk_aes_gcm_setauthsize() argument 1091 switch (authsize) { in mtk_aes_gcm_setauthsize() 1100 gctx->authsize = authsize; in mtk_aes_gcm_setauthsize()
|