Home
last modified time | relevance | path

Searched refs:authsize (Results 1 – 25 of 72) sorted by relevance

123

/linux-6.6.21/include/crypto/
Dgcm.h16 static inline int crypto_gcm_check_authsize(unsigned int authsize) in crypto_gcm_check_authsize() argument
18 switch (authsize) { in crypto_gcm_check_authsize()
37 static inline int crypto_rfc4106_check_authsize(unsigned int authsize) in crypto_rfc4106_check_authsize() argument
39 switch (authsize) { in crypto_rfc4106_check_authsize()
70 unsigned int authsize; member
74 unsigned int keysize, unsigned int authsize);
Daead.h159 int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize);
177 unsigned int authsize; member
264 return tfm->authsize; in crypto_aead_authsize()
341 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize);
/linux-6.6.21/drivers/crypto/nx/
Dnx-aes-ccm.c70 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()
156 unsigned int authsize, in generate_pat() argument
208 rc = generate_b0(iv, assoclen, authsize, nbytes, b0); in generate_pat()
333 unsigned int authsize = crypto_aead_authsize(crypto_aead_reqtfm(req)); in ccm_nx_decrypt() local
341 nbytes -= authsize; in ccm_nx_decrypt()
[all …]
/linux-6.6.21/arch/x86/crypto/
Daegis128-aesni-glue.c156 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-6.6.21/crypto/
Dauthencesn.c50 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()
128 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_genicv() local
134 if (!authsize) in crypto_authenc_esn_genicv()
221 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_decrypt_tail() local
229 unsigned int cryptlen = req->cryptlen - authsize; in crypto_authenc_esn_decrypt_tail()
235 if (!authsize) in crypto_authenc_esn_decrypt_tail()
243 if (crypto_memneq(ihash, ohash, authsize)) in crypto_authenc_esn_decrypt_tail()
[all …]
Daegis128-core.c379 unsigned int authsize) in crypto_aegis128_setauthsize() argument
381 if (authsize > AEGIS128_MAX_AUTH_SIZE) in crypto_aegis128_setauthsize()
383 if (authsize < AEGIS128_MIN_AUTH_SIZE) in crypto_aegis128_setauthsize()
392 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_encrypt_generic() local
406 authsize, 1); in crypto_aegis128_encrypt_generic()
415 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_decrypt_generic() local
416 unsigned int cryptlen = req->cryptlen - authsize; in crypto_aegis128_decrypt_generic()
422 authsize, 0); in crypto_aegis128_decrypt_generic()
431 if (unlikely(crypto_memneq(tag.bytes, zeros, authsize))) { in crypto_aegis128_decrypt_generic()
453 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_encrypt_simd() local
[all …]
Daead.c74 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in crypto_aead_setauthsize() argument
78 if ((!authsize && crypto_aead_maxauthsize(tfm)) || in crypto_aead_setauthsize()
79 authsize > crypto_aead_maxauthsize(tfm)) in crypto_aead_setauthsize()
83 err = crypto_aead_alg(tfm)->setauthsize(tfm, authsize); in crypto_aead_setauthsize()
88 tfm->authsize = authsize; in crypto_aead_setauthsize()
167 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm()
Dgcm.c147 unsigned int authsize) in crypto_gcm_setauthsize() argument
149 return crypto_gcm_check_authsize(authsize); in crypto_gcm_setauthsize()
469 unsigned int authsize = crypto_aead_authsize(aead); in crypto_gcm_verify() local
470 unsigned int cryptlen = req->cryptlen - authsize; in crypto_gcm_verify()
474 req->assoclen + cryptlen, authsize, 0); in crypto_gcm_verify()
475 return crypto_memneq(iauth_tag, auth_tag, authsize) ? -EBADMSG : 0; in crypto_gcm_verify()
504 unsigned int authsize = crypto_aead_authsize(aead); in crypto_gcm_decrypt() local
508 cryptlen -= authsize; in crypto_gcm_decrypt()
708 unsigned int authsize) in crypto_rfc4106_setauthsize() argument
713 err = crypto_rfc4106_check_authsize(authsize); in crypto_rfc4106_setauthsize()
[all …]
Daegis128-neon.c59 unsigned int authsize) in crypto_aegis128_final_simd() argument
65 authsize); in crypto_aegis128_final_simd()
Dccm.c109 unsigned int authsize) in crypto_ccm_setauthsize() argument
111 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 …]
/linux-6.6.21/drivers/crypto/cavium/nitrox/
Dnitrox_aead.c59 unsigned int authsize) in nitrox_aead_setauthsize() argument
66 flags.w0.mac_len = authsize; in nitrox_aead_setauthsize()
69 aead->authsize = authsize; in nitrox_aead_setauthsize()
75 unsigned int authsize) in nitrox_aes_gcm_setauthsize() argument
77 switch (authsize) { in nitrox_aes_gcm_setauthsize()
90 return nitrox_aead_setauthsize(aead, authsize); in nitrox_aes_gcm_setauthsize()
230 rctx->dstlen = rctx->srclen + aead->authsize; in nitrox_aes_gcm_enc()
261 rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_aes_gcm_dec()
264 rctx->dstlen = rctx->srclen - aead->authsize; in nitrox_aes_gcm_dec()
379 unsigned int authsize) in nitrox_rfc4106_setauthsize() argument
[all …]
/linux-6.6.21/arch/arm64/crypto/
Dsm4-ce-ccm-glue.c46 static int ccm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in ccm_setauthsize() argument
48 if ((authsize & 1) || authsize < 4) in ccm_setauthsize()
243 unsigned int authsize = crypto_aead_authsize(aead); in ccm_decrypt() local
250 err = ccm_format_input(mac, req, req->cryptlen - authsize); in ccm_decrypt()
264 req->assoclen + req->cryptlen - authsize, in ccm_decrypt()
265 authsize, 0); in ccm_decrypt()
267 if (crypto_memneq(authtag, mac, authsize)) in ccm_decrypt()
Daes-ce-ccm-glue.c52 static int ccm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in ccm_setauthsize() argument
54 if ((authsize & 1) || authsize < 4) in ccm_setauthsize()
203 unsigned int authsize = crypto_aead_authsize(aead); in ccm_decrypt() local
207 u32 len = req->cryptlen - authsize; in ccm_decrypt()
251 req->assoclen + req->cryptlen - authsize, in ccm_decrypt()
252 authsize, 0); in ccm_decrypt()
254 if (crypto_memneq(mac, buf, authsize)) in ccm_decrypt()
Dsm4-ce-gcm-glue.c61 static int gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in gcm_setauthsize() argument
63 switch (authsize) { in gcm_setauthsize()
220 unsigned int authsize = crypto_aead_authsize(aead); in gcm_decrypt() local
233 req->assoclen + req->cryptlen - authsize, in gcm_decrypt()
234 authsize, 0); in gcm_decrypt()
236 if (crypto_memneq(authtag, ghash, authsize)) in gcm_decrypt()
Dghash-ce-glue.c64 const u8 tag[], u64 authsize);
264 static int gcm_aes_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in gcm_aes_setauthsize() argument
266 return crypto_gcm_check_authsize(authsize); in gcm_aes_setauthsize()
402 unsigned int authsize = crypto_aead_authsize(aead); in gcm_decrypt() local
414 lengths.b = cpu_to_be64((req->cryptlen - authsize) * 8); in gcm_decrypt()
422 req->assoclen + req->cryptlen - authsize, in gcm_decrypt()
423 authsize, 0); in gcm_decrypt()
445 nrounds, tag, otag, authsize); in gcm_decrypt()
495 static int rfc4106_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in rfc4106_setauthsize() argument
497 return crypto_rfc4106_check_authsize(authsize); in rfc4106_setauthsize()
/linux-6.6.21/drivers/crypto/qce/
Daead.c74 totallen, ctx->authsize, 1); in qce_aead_done()
77 totallen, ctx->authsize, 1); in qce_aead_done()
80 totallen = req->cryptlen + req->assoclen - ctx->authsize; in qce_aead_done()
81 scatterwalk_map_and_copy(tag, req->src, totallen, ctx->authsize, 0); in qce_aead_done()
82 ret = memcmp(result_buf->auth_iv, tag, ctx->authsize); in qce_aead_done()
198 cryptlen = rctx->cryptlen + ctx->authsize; in qce_aead_ccm_prepare_buf_assoclen()
344 cryptlen = rctx->cryptlen + ctx->authsize; in qce_aead_ccm_prepare_buf()
399 rctx->ccm_nonce[0] |= ((ctx->authsize - 2) / 2) << in qce_aead_create_ccm_nonce()
516 rctx->cryptlen = req->cryptlen - ctx->authsize; in qce_aead_crypt()
651 static int qce_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in qce_aead_setauthsize() argument
[all …]
/linux-6.6.21/drivers/crypto/
Domap-aes-gcm.c71 dd->authsize, 1); in omap_aes_gcm_done_task()
81 for (i = 0; i < dd->authsize; i++) { in omap_aes_gcm_done_task()
151 dd->authsize = authlen; in omap_aes_gcm_copy_buffers()
195 dd->authsize, 0); in omap_aes_gcm_dma_out_callback()
349 int omap_aes_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in omap_aes_gcm_setauthsize() argument
351 return crypto_gcm_check_authsize(authsize); in omap_aes_gcm_setauthsize()
355 unsigned int authsize) in omap_aes_4106gcm_setauthsize() argument
357 return crypto_rfc4106_check_authsize(authsize); in omap_aes_4106gcm_setauthsize()
/linux-6.6.21/drivers/crypto/caam/
Dcaamalg_qi.c73 unsigned int authsize; member
100 if (!ctx->cdata.keylen || !ctx->authsize) in aead_set_sh_desc()
150 ivsize, ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc()
165 ivsize, ctx->authsize, alg->caam.geniv, in aead_set_sh_desc()
183 ivsize, ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc()
190 static int aead_setauthsize(struct crypto_aead *authenc, unsigned int authsize) in aead_setauthsize() argument
194 ctx->authsize = authsize; in aead_setauthsize()
312 if (!ctx->cdata.keylen || !ctx->authsize) in gcm_set_sh_desc()
328 ctx->authsize, true); in gcm_set_sh_desc()
343 ctx->authsize, true); in gcm_set_sh_desc()
[all …]
Dcaamalg.c126 unsigned int authsize; member
163 cnstr_shdsc_aead_null_encap(desc, &ctx->adata, ctx->authsize, in aead_null_set_sh_desc()
182 cnstr_shdsc_aead_null_decap(desc, &ctx->adata, ctx->authsize, in aead_null_set_sh_desc()
207 if (!ctx->authsize) in aead_set_sh_desc()
266 ctx->authsize, is_rfc3686, nonce, ctx1_iv_off, in aead_set_sh_desc()
288 ctx->authsize, alg->caam.geniv, is_rfc3686, in aead_set_sh_desc()
312 ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc()
322 unsigned int authsize) in aead_setauthsize() argument
326 ctx->authsize = authsize; in aead_setauthsize()
341 if (!ctx->cdata.keylen || !ctx->authsize) in gcm_set_sh_desc()
[all …]
/linux-6.6.21/drivers/crypto/ccree/
Dcc_aead.c57 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 …]
Dcc_buffer_mgr.c538 static bool cc_is_icv_frag(unsigned int sgl_nents, unsigned int authsize, in cc_is_icv_frag() argument
541 return ((sgl_nents > 1) && (last_entry_data_size < authsize)); in cc_is_icv_frag()
657 unsigned int authsize = areq_ctx->req_authsize; in cc_prepare_aead_data_dlli() local
665 offset = *src_last_bytes - authsize; in cc_prepare_aead_data_dlli()
668 offset = *dst_last_bytes - authsize; in cc_prepare_aead_data_dlli()
683 unsigned int authsize = areq_ctx->req_authsize; in cc_prepare_aead_data_mlli() local
695 cc_is_icv_frag(areq_ctx->src.nents, authsize, in cc_prepare_aead_data_mlli()
722 (*src_last_bytes - authsize); in cc_prepare_aead_data_mlli()
724 (*src_last_bytes - authsize); in cc_prepare_aead_data_mlli()
739 cc_is_icv_frag(areq_ctx->src.nents, authsize, in cc_prepare_aead_data_mlli()
[all …]
/linux-6.6.21/lib/crypto/
Daesgcm.c47 unsigned int keysize, unsigned int authsize) in aesgcm_expandkey() argument
52 ret = crypto_gcm_check_authsize(authsize) ?: in aesgcm_expandkey()
57 ctx->authsize = authsize; in aesgcm_expandkey()
89 crypto_xor_cpy(authtag, buf, (u8 *)&ghash, ctx->authsize); in aesgcm_mac()
176 if (crypto_memneq(authtag, tagbuf, ctx->authsize)) { in aesgcm_decrypt()
/linux-6.6.21/drivers/crypto/intel/ixp4xx/
Dixp4xx_crypto.c356 int authsize = crypto_aead_authsize(tfm); in finish_scattered_hmac() local
357 int decryptlen = req->assoclen + req->cryptlen - authsize; in finish_scattered_hmac()
361 decryptlen, authsize, 1); in finish_scattered_hmac()
736 static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned int authsize, in setup_auth() argument
752 cfgword = algo->cfgword | (authsize << 6); /* (authsize/4) << 8 */ in setup_auth()
1094 unsigned int authsize = crypto_aead_authsize(tfm); in aead_perform() local
1117 cryptlen = req->cryptlen - authsize; in aead_perform()
1118 eff_cryptlen -= authsize; in aead_perform()
1145 if (lastlen >= authsize) in aead_perform()
1147 buf->buf_len - authsize; in aead_perform()
[all …]
/linux-6.6.21/drivers/crypto/starfive/
Djh7110-aes.c219 b0[0] |= (8 * ((cryp->authsize - 2) / 2)); in starfive_aes_ccm_init()
328 scatterwalk_copychunks(cryp->tag_out, &cryp->out_walk, cryp->authsize, 1); in starfive_aes_read_authtag()
330 scatterwalk_copychunks(cryp->tag_in, &cryp->in_walk, cryp->authsize, 0); in starfive_aes_read_authtag()
332 if (crypto_memneq(cryp->tag_in, cryp->tag_out, cryp->authsize)) in starfive_aes_read_authtag()
344 if (!err && cryp->authsize) in starfive_aes_finish_req()
356 if (cryp->authsize) in starfive_aes_finish_req()
482 cryp->authsize = 0; in starfive_aes_prepare_req()
486 cryp->authsize = crypto_aead_authsize(crypto_aead_reqtfm(areq)); in starfive_aes_prepare_req()
491 cryp->total_in = areq->cryptlen - cryp->authsize; in starfive_aes_prepare_req()
740 unsigned int authsize) in starfive_aes_gcm_setauthsize() argument
[all …]
/linux-6.6.21/drivers/crypto/xilinx/
Dzynqmp-aes-gcm.c68 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()

123