/Linux-v5.10/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 | 139 int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize); 153 unsigned int authsize; member 233 return tfm->authsize; in crypto_aead_authsize() 310 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize);
|
/Linux-v5.10/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.10/arch/x86/crypto/ |
D | aegis128-aesni-glue.c | 156 unsigned int authsize) in crypto_aegis128_aesni_setauthsize() argument 158 if (authsize > AEGIS128_MAX_AUTH_SIZE) in crypto_aegis128_aesni_setauthsize() 160 if (authsize < AEGIS128_MIN_AUTH_SIZE) in crypto_aegis128_aesni_setauthsize() 197 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_aesni_encrypt() local 203 req->assoclen + cryptlen, authsize, 1); in crypto_aegis128_aesni_encrypt() 219 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_aesni_decrypt() local 220 unsigned int cryptlen = req->cryptlen - authsize; in crypto_aegis128_aesni_decrypt() 223 req->assoclen + cryptlen, authsize, 0); in crypto_aegis128_aesni_decrypt() 227 return crypto_memneq(tag.bytes, zeros.bytes, authsize) ? -EBADMSG : 0; in crypto_aegis128_aesni_decrypt()
|
/Linux-v5.10/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() 95 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_genicv_tail() local 106 scatterwalk_map_and_copy(hash, dst, assoclen + cryptlen, authsize, 1); in crypto_authenc_esn_genicv_tail() 129 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_genicv() local 135 if (!authsize) in crypto_authenc_esn_genicv() 223 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_decrypt_tail() local 231 unsigned int cryptlen = req->cryptlen - authsize; in crypto_authenc_esn_decrypt_tail() 237 if (!authsize) in crypto_authenc_esn_decrypt_tail() 245 if (crypto_memneq(ihash, ohash, authsize)) in crypto_authenc_esn_decrypt_tail() [all …]
|
D | aead.c | 64 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in crypto_aead_setauthsize() argument 68 if ((!authsize && crypto_aead_maxauthsize(tfm)) || in crypto_aead_setauthsize() 69 authsize > crypto_aead_maxauthsize(tfm)) in crypto_aead_setauthsize() 73 err = crypto_aead_alg(tfm)->setauthsize(tfm, authsize); in crypto_aead_setauthsize() 78 tfm->authsize = authsize; in crypto_aead_setauthsize() 134 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm()
|
D | aegis128-core.c | 383 unsigned int authsize) in crypto_aegis128_setauthsize() argument 385 if (authsize > AEGIS128_MAX_AUTH_SIZE) in crypto_aegis128_setauthsize() 387 if (authsize < AEGIS128_MIN_AUTH_SIZE) in crypto_aegis128_setauthsize() 396 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_encrypt() local 419 authsize, 1); in crypto_aegis128_encrypt() 428 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_decrypt() local 429 unsigned int cryptlen = req->cryptlen - authsize; in crypto_aegis128_decrypt() 435 authsize, 0); in crypto_aegis128_decrypt() 453 return crypto_memneq(tag.bytes, zeros, authsize) ? -EBADMSG : 0; in crypto_aegis128_decrypt()
|
D | gcm.c | 147 unsigned int authsize) in crypto_gcm_setauthsize() argument 149 return crypto_gcm_check_authsize(authsize); in crypto_gcm_setauthsize() 471 unsigned int authsize = crypto_aead_authsize(aead); in crypto_gcm_verify() local 472 unsigned int cryptlen = req->cryptlen - authsize; in crypto_gcm_verify() 476 req->assoclen + cryptlen, authsize, 0); in crypto_gcm_verify() 477 return crypto_memneq(iauth_tag, auth_tag, authsize) ? -EBADMSG : 0; in crypto_gcm_verify() 506 unsigned int authsize = crypto_aead_authsize(aead); in crypto_gcm_decrypt() local 510 cryptlen -= authsize; in crypto_gcm_decrypt() 710 unsigned int authsize) in crypto_rfc4106_setauthsize() argument 715 err = crypto_rfc4106_check_authsize(authsize); in crypto_rfc4106_setauthsize() [all …]
|
D | ccm.c | 108 unsigned int authsize) in crypto_ccm_setauthsize() argument 110 switch (authsize) { in crypto_ccm_setauthsize() 328 unsigned int authsize = crypto_aead_authsize(aead); in crypto_ccm_decrypt_done() local 329 unsigned int cryptlen = req->cryptlen - authsize; in crypto_ccm_decrypt_done() 338 if (!err && crypto_memneq(pctx->auth_tag, pctx->odata, authsize)) in crypto_ccm_decrypt_done() 351 unsigned int authsize = crypto_aead_authsize(aead); in crypto_ccm_decrypt() local 358 cryptlen -= authsize; in crypto_ccm_decrypt() 365 authsize, 0); in crypto_ccm_decrypt() 386 if (crypto_memneq(authtag, odata, authsize)) in crypto_ccm_decrypt() 587 unsigned int authsize) in crypto_rfc4309_setauthsize() argument [all …]
|
D | authenc.c | 240 unsigned int authsize = crypto_aead_authsize(authenc); in crypto_authenc_decrypt_tail() local 241 u8 *ihash = ahreq->result + authsize; in crypto_authenc_decrypt_tail() 244 scatterwalk_map_and_copy(ihash, req->src, ahreq->nbytes, authsize, 0); in crypto_authenc_decrypt_tail() 246 if (crypto_memneq(ihash, ahreq->result, authsize)) in crypto_authenc_decrypt_tail() 259 req->cryptlen - authsize, req->iv); in crypto_authenc_decrypt_tail() 281 unsigned int authsize = crypto_aead_authsize(authenc); in crypto_authenc_decrypt() local 296 req->assoclen + req->cryptlen - authsize); in crypto_authenc_decrypt()
|
/Linux-v5.10/drivers/crypto/cavium/nitrox/ |
D | nitrox_aead.c | 60 unsigned int authsize) in nitrox_aead_setauthsize() argument 67 flags.w0.mac_len = authsize; in nitrox_aead_setauthsize() 70 aead->authsize = authsize; in nitrox_aead_setauthsize() 76 unsigned int authsize) in nitrox_aes_gcm_setauthsize() argument 78 switch (authsize) { in nitrox_aes_gcm_setauthsize() 91 return nitrox_aead_setauthsize(aead, authsize); in nitrox_aes_gcm_setauthsize() 231 rctx->dstlen = rctx->srclen + aead->authsize; in nitrox_aes_gcm_enc() 262 rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_aes_gcm_dec() 265 rctx->dstlen = rctx->srclen - aead->authsize; in nitrox_aes_gcm_dec() 380 unsigned int authsize) in nitrox_rfc4106_setauthsize() argument [all …]
|
/Linux-v5.10/arch/arm64/crypto/ |
D | aes-ce-ccm-glue.c | 54 static int ccm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in ccm_setauthsize() argument 56 if ((authsize & 1) || authsize < 4) in ccm_setauthsize() 283 unsigned int authsize = crypto_aead_authsize(aead); in ccm_decrypt() local 287 u32 len = req->cryptlen - authsize; in ccm_decrypt() 333 req->assoclen + req->cryptlen - authsize, in ccm_decrypt() 334 authsize, 0); in ccm_decrypt() 336 if (crypto_memneq(mac, buf, authsize)) in ccm_decrypt()
|
D | ghash-ce-glue.c | 261 static int gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in gcm_setauthsize() argument 263 switch (authsize) { in gcm_setauthsize() 458 unsigned int authsize = crypto_aead_authsize(aead); in gcm_decrypt() local 469 lengths.b = cpu_to_be64((req->cryptlen - authsize) * 8); in gcm_decrypt() 563 req->assoclen + req->cryptlen - authsize, in gcm_decrypt() 564 authsize, 0); in gcm_decrypt() 566 if (crypto_memneq(tag, buf, authsize)) in gcm_decrypt()
|
/Linux-v5.10/drivers/crypto/caam/ |
D | caamalg.c | 118 unsigned int authsize; member 155 cnstr_shdsc_aead_null_encap(desc, &ctx->adata, ctx->authsize, in aead_null_set_sh_desc() 174 cnstr_shdsc_aead_null_decap(desc, &ctx->adata, ctx->authsize, in aead_null_set_sh_desc() 198 if (!ctx->authsize) in aead_set_sh_desc() 257 ctx->authsize, is_rfc3686, nonce, ctx1_iv_off, in aead_set_sh_desc() 279 ctx->authsize, alg->caam.geniv, is_rfc3686, in aead_set_sh_desc() 303 ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc() 313 unsigned int authsize) in aead_setauthsize() argument 317 ctx->authsize = authsize; in aead_setauthsize() 332 if (!ctx->cdata.keylen || !ctx->authsize) in gcm_set_sh_desc() [all …]
|
D | caamalg_qi.c | 68 unsigned int authsize; member 95 if (!ctx->cdata.keylen || !ctx->authsize) in aead_set_sh_desc() 145 ivsize, ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc() 160 ivsize, ctx->authsize, alg->caam.geniv, in aead_set_sh_desc() 178 ivsize, ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc() 185 static int aead_setauthsize(struct crypto_aead *authenc, unsigned int authsize) in aead_setauthsize() argument 189 ctx->authsize = authsize; in aead_setauthsize() 307 if (!ctx->cdata.keylen || !ctx->authsize) in gcm_set_sh_desc() 323 ctx->authsize, true); in gcm_set_sh_desc() 338 ctx->authsize, true); in gcm_set_sh_desc() [all …]
|
/Linux-v5.10/drivers/crypto/ccree/ |
D | cc_buffer_mgr.c | 529 static bool cc_is_icv_frag(unsigned int sgl_nents, unsigned int authsize, in cc_is_icv_frag() argument 532 return ((sgl_nents > 1) && (last_entry_data_size < authsize)); in cc_is_icv_frag() 648 unsigned int authsize = areq_ctx->req_authsize; in cc_prepare_aead_data_dlli() local 656 offset = *src_last_bytes - authsize; in cc_prepare_aead_data_dlli() 659 offset = *dst_last_bytes - authsize; in cc_prepare_aead_data_dlli() 674 unsigned int authsize = areq_ctx->req_authsize; in cc_prepare_aead_data_mlli() local 686 cc_is_icv_frag(areq_ctx->src.nents, authsize, in cc_prepare_aead_data_mlli() 713 (*src_last_bytes - authsize); in cc_prepare_aead_data_mlli() 715 (*src_last_bytes - authsize); in cc_prepare_aead_data_mlli() 730 cc_is_icv_frag(areq_ctx->src.nents, authsize, in cc_prepare_aead_data_mlli() [all …]
|
D | cc_aead.c | 57 unsigned int authsize; /* Actual (reduced?) size of the MAC/ICv */ member 229 ctx->authsize) != 0) { in cc_aead_complete() 231 ctx->authsize, ctx->cipher_mode); in cc_aead_complete() 244 skip, (skip + ctx->authsize), in cc_aead_complete() 670 unsigned int authsize) in cc_aead_setauthsize() argument 676 if (authsize == 0 || in cc_aead_setauthsize() 677 authsize > crypto_aead_maxauthsize(authenc)) { in cc_aead_setauthsize() 681 ctx->authsize = authsize; in cc_aead_setauthsize() 682 dev_dbg(dev, "authlen=%d\n", ctx->authsize); in cc_aead_setauthsize() 688 unsigned int authsize) in cc_rfc4309_ccm_setauthsize() argument [all …]
|
/Linux-v5.10/drivers/crypto/ |
D | omap-aes-gcm.c | 68 dd->authsize, 1); in omap_aes_gcm_done_task() 78 for (i = 0; i < dd->authsize; i++) { in omap_aes_gcm_done_task() 148 dd->authsize = authlen; in omap_aes_gcm_copy_buffers() 192 dd->authsize, 0); in omap_aes_gcm_dma_out_callback() 348 int omap_aes_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in omap_aes_gcm_setauthsize() argument 350 return crypto_gcm_check_authsize(authsize); in omap_aes_gcm_setauthsize() 354 unsigned int authsize) in omap_aes_4106gcm_setauthsize() argument 356 return crypto_rfc4106_check_authsize(authsize); in omap_aes_4106gcm_setauthsize()
|
D | ixp4xx_crypto.c | 347 int authsize = crypto_aead_authsize(tfm); in finish_scattered_hmac() local 348 int decryptlen = req->assoclen + req->cryptlen - authsize; in finish_scattered_hmac() 352 req->dst, decryptlen, authsize, 1); in finish_scattered_hmac() 660 static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned authsize, in setup_auth() argument 676 cfgword = algo->cfgword | ( authsize << 6); /* (authsize/4) << 8 */ in setup_auth() 978 unsigned authsize = crypto_aead_authsize(tfm); in aead_perform() local 1001 cryptlen = req->cryptlen -authsize; in aead_perform() 1002 eff_cryptlen -= authsize; in aead_perform() 1029 if (lastlen >= authsize) in aead_perform() 1031 buf->buf_len - authsize; in aead_perform() [all …]
|
D | omap-aes.h | 181 size_t authsize; member 210 int omap_aes_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize); 214 unsigned int authsize);
|
/Linux-v5.10/drivers/crypto/xilinx/ |
D | zynqmp-aes-gcm.c | 68 u32 authsize; member 183 if (tfm_ctx->authsize != ZYNQMP_AES_AUTH_SIZE) in zynqmp_fallback_check() 271 unsigned int authsize) in zynqmp_aes_aead_setauthsize() argument 277 tfm_ctx->authsize = authsize; in zynqmp_aes_aead_setauthsize() 278 return crypto_aead_setauthsize(tfm_ctx->fbk_cipher, authsize); in zynqmp_aes_aead_setauthsize()
|
/Linux-v5.10/drivers/crypto/chelsio/ |
D | chcr_algo.c | 179 int authsize = crypto_aead_authsize(tfm); in chcr_verify_tag() local 186 cmp = crypto_memneq(&fw6_pld->data[2], (fw6_pld + 1), authsize); in chcr_verify_tag() 190 authsize, req->assoclen + in chcr_verify_tag() 191 req->cryptlen - authsize); in chcr_verify_tag() 192 cmp = crypto_memneq(temp, (fw6_pld + 1), authsize); in chcr_verify_tag() 2379 unsigned int authsize = crypto_aead_authsize(tfm); in chcr_aead_common_init() local 2385 if (reqctx->op && req->cryptlen < authsize) in chcr_aead_common_init() 2408 unsigned int authsize = crypto_aead_authsize(crypto_aead_reqtfm(req)); in chcr_aead_need_fallback() local 2410 if (((req->cryptlen - (op_type ? authsize : 0)) == 0) || in chcr_aead_need_fallback() 2450 unsigned int authsize = crypto_aead_authsize(tfm); in create_authenc_wr() local [all …]
|
/Linux-v5.10/drivers/crypto/marvell/octeontx/ |
D | otx_cptvf_algs.c | 619 unsigned int authsize) in otx_cpt_aead_set_authsize() argument 625 if (authsize != SHA1_DIGEST_SIZE && in otx_cpt_aead_set_authsize() 626 authsize != SHA1_TRUNC_DIGEST_SIZE) in otx_cpt_aead_set_authsize() 629 if (authsize == SHA1_TRUNC_DIGEST_SIZE) in otx_cpt_aead_set_authsize() 634 if (authsize != SHA256_DIGEST_SIZE && in otx_cpt_aead_set_authsize() 635 authsize != SHA256_TRUNC_DIGEST_SIZE) in otx_cpt_aead_set_authsize() 638 if (authsize == SHA256_TRUNC_DIGEST_SIZE) in otx_cpt_aead_set_authsize() 643 if (authsize != SHA384_DIGEST_SIZE && in otx_cpt_aead_set_authsize() 644 authsize != SHA384_TRUNC_DIGEST_SIZE) in otx_cpt_aead_set_authsize() 647 if (authsize == SHA384_TRUNC_DIGEST_SIZE) in otx_cpt_aead_set_authsize() [all …]
|
/Linux-v5.10/drivers/crypto/ccp/ |
D | ccp-crypto-aes-galois.c | 58 unsigned int authsize) in ccp_aes_gcm_setauthsize() argument 60 switch (authsize) { in ccp_aes_gcm_setauthsize() 119 rctx->cmd.u.aes.authsize = crypto_aead_authsize(tfm); in ccp_aes_gcm_crypt()
|
/Linux-v5.10/drivers/crypto/stm32/ |
D | stm32-cryp.c | 144 size_t authsize; member 466 cryp->areq->cryptlen - cryp->authsize; in stm32_cryp_get_input_text_len() 507 b0[0] |= (8 * ((cryp->authsize - 2) / 2)); in stm32_cryp_ccm_init() 802 unsigned int authsize) in stm32_cryp_aes_gcm_setauthsize() argument 804 return authsize == AES_BLOCK_SIZE ? 0 : -EINVAL; in stm32_cryp_aes_gcm_setauthsize() 808 unsigned int authsize) in stm32_cryp_aes_ccm_setauthsize() argument 810 switch (authsize) { in stm32_cryp_aes_ccm_setauthsize() 973 cryp->authsize = crypto_aead_authsize(crypto_aead_reqtfm(areq)); in stm32_cryp_prepare_req() 977 cryp->total_out = cryp->total_in + cryp->authsize; in stm32_cryp_prepare_req() 980 cryp->total_out = cryp->total_in - cryp->authsize; in stm32_cryp_prepare_req() [all …]
|