Home
last modified time | relevance | path

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

123

/linux-6.1.9/include/crypto/
Dgcm.h13 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()
Daead.h141 int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize);
155 unsigned int authsize; member
242 return tfm->authsize; in crypto_aead_authsize()
319 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize);
/linux-6.1.9/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.1.9/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.1.9/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()
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 …]
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.c64 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()
Daegis128-neon.c20 unsigned int authsize);
69 unsigned int authsize) in crypto_aegis128_final_simd() argument
75 authsize); in crypto_aegis128_final_simd()
Dgcm.c147 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 …]
Dccm.c109 unsigned int authsize) in crypto_ccm_setauthsize() argument
111 switch (authsize) { in crypto_ccm_setauthsize()
329 unsigned int authsize = crypto_aead_authsize(aead); in crypto_ccm_decrypt_done() local
330 unsigned int cryptlen = req->cryptlen - authsize; in crypto_ccm_decrypt_done()
339 if (!err && crypto_memneq(pctx->auth_tag, pctx->odata, authsize)) in crypto_ccm_decrypt_done()
352 unsigned int authsize = crypto_aead_authsize(aead); in crypto_ccm_decrypt() local
359 cryptlen -= authsize; in crypto_ccm_decrypt()
366 authsize, 0); in crypto_ccm_decrypt()
387 if (crypto_memneq(authtag, odata, authsize)) in crypto_ccm_decrypt()
588 unsigned int authsize) in crypto_rfc4309_setauthsize() argument
[all …]
Dauthenc.c240 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-6.1.9/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.1.9/arch/arm64/crypto/
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()
207 unsigned int authsize = crypto_aead_authsize(aead); in ccm_decrypt() local
211 u32 len = req->cryptlen - authsize; in ccm_decrypt()
256 req->assoclen + req->cryptlen - authsize, in ccm_decrypt()
257 authsize, 0); in ccm_decrypt()
259 if (crypto_memneq(mac, buf, authsize)) in ccm_decrypt()
Dghash-ce-glue.c61 const u8 tag[], u64 authsize);
261 static int gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in gcm_setauthsize() argument
263 switch (authsize) { in gcm_setauthsize()
410 unsigned int authsize = crypto_aead_authsize(aead); in gcm_decrypt() local
423 lengths.b = cpu_to_be64((req->cryptlen - authsize) * 8); in gcm_decrypt()
432 req->assoclen + req->cryptlen - authsize, in gcm_decrypt()
433 authsize, 0); in gcm_decrypt()
455 nrounds, tag, otag, authsize); in gcm_decrypt()
/linux-6.1.9/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.1.9/drivers/crypto/caam/
Dcaamalg.c118 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 …]
Dcaamalg_qi.c68 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-6.1.9/drivers/crypto/
Domap-aes-gcm.c68 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()
Dixp4xx_crypto.c354 int authsize = crypto_aead_authsize(tfm); in finish_scattered_hmac() local
355 int decryptlen = req->assoclen + req->cryptlen - authsize; in finish_scattered_hmac()
359 decryptlen, authsize, 1); in finish_scattered_hmac()
734 static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned int authsize, in setup_auth() argument
750 cfgword = algo->cfgword | (authsize << 6); /* (authsize/4) << 8 */ in setup_auth()
1092 unsigned int authsize = crypto_aead_authsize(tfm); in aead_perform() local
1115 cryptlen = req->cryptlen - authsize; in aead_perform()
1116 eff_cryptlen -= authsize; in aead_perform()
1143 if (lastlen >= authsize) in aead_perform()
1145 buf->buf_len - authsize; in aead_perform()
[all …]
Domap-aes.h181 size_t authsize; member
210 int omap_aes_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize);
214 unsigned int authsize);
/linux-6.1.9/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.1.9/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()
/linux-6.1.9/drivers/crypto/chelsio/
Dchcr_algo.c175 int authsize = crypto_aead_authsize(tfm); in chcr_verify_tag() local
182 cmp = crypto_memneq(&fw6_pld->data[2], (fw6_pld + 1), authsize); in chcr_verify_tag()
186 authsize, req->assoclen + in chcr_verify_tag()
187 req->cryptlen - authsize); in chcr_verify_tag()
188 cmp = crypto_memneq(temp, (fw6_pld + 1), authsize); in chcr_verify_tag()
2377 unsigned int authsize = crypto_aead_authsize(tfm); in chcr_aead_common_init() local
2383 if (reqctx->op && req->cryptlen < authsize) in chcr_aead_common_init()
2406 unsigned int authsize = crypto_aead_authsize(crypto_aead_reqtfm(req)); in chcr_aead_need_fallback() local
2408 if (((req->cryptlen - (op_type ? authsize : 0)) == 0) || in chcr_aead_need_fallback()
2449 unsigned int authsize = crypto_aead_authsize(tfm); in create_authenc_wr() local
[all …]
/linux-6.1.9/drivers/crypto/hisilicon/sec2/
Dsec_crypto.c902 size_t authsize; in GEN_SEC_SETKEY_FUNC() local
918 authsize = crypto_aead_authsize(tfm); in GEN_SEC_SETKEY_FUNC()
919 mac_offset = qp_ctx->res[req_id].pbuf + copy_size - authsize; in GEN_SEC_SETKEY_FUNC()
920 memcpy(a_req->out_mac, mac_offset, authsize); in GEN_SEC_SETKEY_FUNC()
953 size_t authsize = crypto_aead_authsize(tfm); in sec_aead_mac_init() local
960 skip_size = aead_req->assoclen + aead_req->cryptlen - authsize; in sec_aead_mac_init()
962 authsize, skip_size); in sec_aead_mac_init()
963 if (unlikely(copy_size != authsize)) in sec_aead_mac_init()
1119 static int sec_aead_setauthsize(struct crypto_aead *aead, unsigned int authsize) in sec_aead_setauthsize() argument
1126 return crypto_aead_setauthsize(a_ctx->fallback_aead_tfm, authsize); in sec_aead_setauthsize()
[all …]

123