Home
last modified time | relevance | path

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

123

/linux/include/crypto/
H A 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);
H A Daead.h142 int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize);
156 unsigned int authsize; member
255 return tfm->authsize; in crypto_aead_authsize()
332 int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize);
/linux/drivers/crypto/nx/
H A 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/crypto/
H A Dauthencesn.c50 unsigned int authsize) in crypto_authenc_esn_setauthsize() argument
52 if (authsize > 0 && authsize < 4) in crypto_authenc_esn_setauthsize()
92 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_genicv_tail() local
103 scatterwalk_map_and_copy(hash, dst, assoclen + cryptlen, authsize, 1); in crypto_authenc_esn_genicv_tail()
124 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_genicv() local
130 if (!authsize) in crypto_authenc_esn_genicv()
217 unsigned int authsize = crypto_aead_authsize(authenc_esn); in crypto_authenc_esn_decrypt_tail() local
224 unsigned int cryptlen = req->cryptlen - authsize; in crypto_authenc_esn_decrypt_tail()
230 if (!authsize) in crypto_authenc_esn_decrypt_tail()
238 if (crypto_memneq(ihash, ohash, authsize)) in crypto_authenc_esn_decrypt_tail()
[all …]
H A Daegis128-core.c380 unsigned int authsize) in crypto_aegis128_setauthsize() argument
382 if (authsize > AEGIS128_MAX_AUTH_SIZE) in crypto_aegis128_setauthsize()
384 if (authsize < AEGIS128_MIN_AUTH_SIZE) in crypto_aegis128_setauthsize()
393 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_encrypt_generic() local
407 authsize, 1); in crypto_aegis128_encrypt_generic()
416 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_decrypt_generic() local
417 unsigned int cryptlen = req->cryptlen - authsize; in crypto_aegis128_decrypt_generic()
423 authsize, 0); in crypto_aegis128_decrypt_generic()
432 if (unlikely(crypto_memneq(tag.bytes, zeros, authsize))) { in crypto_aegis128_decrypt_generic()
454 unsigned int authsize = crypto_aead_authsize(tfm); in crypto_aegis128_encrypt_simd() local
[all …]
H A 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()
123 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm()
H A 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()
706 unsigned int authsize) in crypto_rfc4106_setauthsize() argument
711 err = crypto_rfc4106_check_authsize(authsize); in crypto_rfc4106_setauthsize()
[all …]
H A Dauthenc.c236 unsigned int authsize = crypto_aead_authsize(authenc); in crypto_authenc_decrypt_tail() local
237 u8 *ihash = ahreq->result + authsize; in crypto_authenc_decrypt_tail()
240 scatterwalk_map_and_copy(ihash, req->src, ahreq->nbytes, authsize, 0); in crypto_authenc_decrypt_tail()
242 if (crypto_memneq(ihash, ahreq->result, authsize)) in crypto_authenc_decrypt_tail()
255 req->cryptlen - authsize, req->iv); in crypto_authenc_decrypt_tail()
276 unsigned int authsize = crypto_aead_authsize(authenc); in crypto_authenc_decrypt() local
288 req->assoclen + req->cryptlen - authsize); in crypto_authenc_decrypt()
H A Dccm.c110 unsigned int authsize) in crypto_ccm_setauthsize() argument
112 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()
586 unsigned int authsize) in crypto_rfc4309_setauthsize() argument
[all …]
H A Daegis128-neon.c59 unsigned int authsize) in crypto_aegis128_final_simd() argument
65 authsize); in crypto_aegis128_final_simd()
/linux/drivers/crypto/cavium/nitrox/
H A 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/arch/arm64/crypto/
H A 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()
H A Daes-ce-ccm-glue.c55 static int ccm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in ccm_setauthsize() argument
57 if ((authsize & 1) || authsize < 4) in ccm_setauthsize()
249 unsigned int authsize = crypto_aead_authsize(aead); in ccm_decrypt() local
253 u32 len = req->cryptlen - authsize; in ccm_decrypt()
307 req->assoclen + req->cryptlen - authsize, in ccm_decrypt()
308 authsize, 0); in ccm_decrypt()
310 if (crypto_memneq(mac, orig_iv, authsize)) in ccm_decrypt()
H A 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()
H A 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/drivers/crypto/qce/
H A 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/drivers/crypto/caam/
H A 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 …]
H A 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/drivers/crypto/
H A 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/drivers/crypto/ccree/
H A 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/tools/testing/selftests/bpf/progs/
H A Dcrypto_bench.c15 u32 key_len, authsize; variable
28 .authsize = authsize, in crypto_setup()
H A Dcrypto_sanity.c15 u32 authsize, key_len; variable
59 .authsize = authsize, in skb_crypto_setup()
/linux/lib/crypto/
H A 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()
102 crypto_xor_cpy(authtag, buf, (u8 *)&ghash, ctx->authsize); in aesgcm_mac()
189 if (crypto_memneq(authtag, tagbuf, ctx->authsize)) { in aesgcm_decrypt()
/linux/drivers/crypto/starfive/
H A Djh7110-aes.c209 b0[0] |= (8 * ((cryp->authsize - 2) / 2)); in starfive_aes_ccm_init()
314 cryp->total_in, cryp->authsize, 1); in starfive_aes_read_authtag()
316 if (crypto_memneq(cryp->tag_in, cryp->tag_out, cryp->authsize)) in starfive_aes_read_authtag()
328 if (!err && cryp->authsize) in starfive_aes_finish_req()
335 if (cryp->authsize) in starfive_aes_finish_req()
582 cryp->authsize = 0; in starfive_aes_do_one_req()
650 cryp->authsize = crypto_aead_authsize(crypto_aead_reqtfm(req)); in starfive_aes_aead_do_one_req()
662 cryp->total_in = req->cryptlen - cryp->authsize; in starfive_aes_aead_do_one_req()
666 cryp->authsize, 0); in starfive_aes_aead_do_one_req()
893 unsigned int authsize) in starfive_aes_gcm_setauthsize() argument
[all …]
/linux/arch/arm/crypto/
H A Dghash-ce-glue.c380 const char *otag, int authsize);
416 static int gcm_aes_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in gcm_aes_setauthsize() argument
418 return crypto_gcm_check_authsize(authsize); in gcm_aes_setauthsize()
584 int authsize = crypto_aead_authsize(aead); in gcm_decrypt() local
599 req->assoclen + req->cryptlen - authsize, in gcm_decrypt()
600 authsize, 0); in gcm_decrypt()
639 lengths.b = cpu_to_be64((req->cryptlen - authsize) * 8); in gcm_decrypt()
648 ctx->rounds, counter, otag, authsize); in gcm_decrypt()
688 static int rfc4106_setauthsize(struct crypto_aead *tfm, unsigned int authsize) in rfc4106_setauthsize() argument
690 return crypto_rfc4106_check_authsize(authsize); in rfc4106_setauthsize()

123