/linux-6.6.21/drivers/crypto/nx/ |
D | nx-aes-ccm.c | 133 static int generate_b0(u8 *iv, unsigned int assoclen, unsigned int authsize, in generate_b0() argument 147 if (assoclen) in generate_b0() 158 unsigned int assoclen, in generate_pat() argument 185 if (!assoclen) { in generate_pat() 187 } else if (assoclen <= 14) { in generate_pat() 193 iauth_len = assoclen; in generate_pat() 194 } else if (assoclen <= 65280) { in generate_pat() 208 rc = generate_b0(iv, assoclen, authsize, nbytes, b0); in generate_pat() 218 if (assoclen <= 65280) { in generate_pat() 219 *(u16 *)b1 = assoclen; in generate_pat() [all …]
|
D | nx-aes-gcm.c | 102 unsigned int assoclen) in nx_gca() argument 108 unsigned int nbytes = assoclen; in nx_gca() 159 atomic64_add(assoclen, &(nx_ctx->stats->aes_bytes)); in nx_gca() 169 static int gmac(struct aead_request *req, const u8 *iv, unsigned int assoclen) in gmac() argument 176 unsigned int nbytes = assoclen; in gmac() 231 atomic64_add(assoclen, &(nx_ctx->stats->aes_bytes)); in gmac() 308 unsigned int assoclen) in gcm_aes_nx_crypt() argument 325 if (assoclen == 0) in gcm_aes_nx_crypt() 328 rc = gmac(req, rctx->iv, assoclen); in gcm_aes_nx_crypt() 336 csbcpb->cpb.aes_gcm.bit_length_aad = assoclen * 8; in gcm_aes_nx_crypt() [all …]
|
/linux-6.6.21/drivers/crypto/ |
D | omap-aes-gcm.c | 64 dd->aead_req->assoclen, dd->total, in omap_aes_gcm_done_task() 70 dd->total + dd->aead_req->assoclen, in omap_aes_gcm_done_task() 94 int alen, clen, cryptlen, assoclen, ret; in omap_aes_gcm_copy_buffers() local 101 assoclen = req->assoclen; in omap_aes_gcm_copy_buffers() 105 assoclen -= 8; in omap_aes_gcm_copy_buffers() 110 alen = ALIGN(assoclen, AES_BLOCK_SIZE); in omap_aes_gcm_copy_buffers() 113 nsg = !!(assoclen && cryptlen); in omap_aes_gcm_copy_buffers() 118 if (assoclen) { in omap_aes_gcm_copy_buffers() 120 ret = omap_crypto_align_sg(&tmp, assoclen, in omap_aes_gcm_copy_buffers() 132 tmp = scatterwalk_ffwd(sg_arr, req->src, req->assoclen); in omap_aes_gcm_copy_buffers() [all …]
|
/linux-6.6.21/drivers/crypto/cavium/nitrox/ |
D | nitrox_aead.c | 166 creq->gph.param1 = cpu_to_be16(rctx->cryptlen + rctx->assoclen); in nitrox_set_creq() 167 creq->gph.param2 = cpu_to_be16(rctx->ivsize + rctx->assoclen); in nitrox_set_creq() 205 static inline bool nitrox_aes_gcm_assoclen_supported(unsigned int assoclen) in nitrox_aes_gcm_assoclen_supported() argument 207 if (assoclen <= 512) in nitrox_aes_gcm_assoclen_supported() 222 if (!nitrox_aes_gcm_assoclen_supported(areq->assoclen)) in nitrox_aes_gcm_enc() 228 rctx->assoclen = areq->assoclen; in nitrox_aes_gcm_enc() 229 rctx->srclen = areq->assoclen + areq->cryptlen; in nitrox_aes_gcm_enc() 256 if (!nitrox_aes_gcm_assoclen_supported(areq->assoclen)) in nitrox_aes_gcm_dec() 262 rctx->assoclen = areq->assoclen; in nitrox_aes_gcm_dec() 263 rctx->srclen = areq->cryptlen + areq->assoclen; in nitrox_aes_gcm_dec() [all …]
|
/linux-6.6.21/crypto/ |
D | authencesn.c | 96 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_genicv_tail() local 103 scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 0); in crypto_authenc_esn_genicv_tail() 106 scatterwalk_map_and_copy(hash, dst, assoclen + cryptlen, authsize, 1); in crypto_authenc_esn_genicv_tail() 129 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_genicv() local 140 scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 1); in crypto_authenc_esn_genicv() 146 ahash_request_set_crypt(ahreq, dst, hash, assoclen + cryptlen); in crypto_authenc_esn_genicv() 187 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_encrypt() local 193 src = scatterwalk_ffwd(areq_ctx->src, req->src, assoclen); in crypto_authenc_esn_encrypt() 197 err = crypto_authenc_esn_copy(req, assoclen); in crypto_authenc_esn_encrypt() 202 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, assoclen); in crypto_authenc_esn_encrypt() [all …]
|
D | aegis128-core.c | 278 unsigned int assoclen, in crypto_aegis128_process_ad() argument 286 while (assoclen != 0) { in crypto_aegis128_process_ad() 287 unsigned int size = scatterwalk_clamp(&walk, assoclen); in crypto_aegis128_process_ad() 310 assoclen -= size; in crypto_aegis128_process_ad() 313 scatterwalk_done(&walk, 0, assoclen); in crypto_aegis128_process_ad() 346 u64 assoclen, u64 cryptlen) in crypto_aegis128_final() argument 348 u64 assocbits = assoclen * 8; in crypto_aegis128_final() 400 crypto_aegis128_process_ad(&state, req->src, req->assoclen, false); in crypto_aegis128_encrypt_generic() 403 crypto_aegis128_final(&state, &tag, req->assoclen, cryptlen); in crypto_aegis128_encrypt_generic() 405 scatterwalk_map_and_copy(tag.bytes, req->dst, req->assoclen + cryptlen, in crypto_aegis128_encrypt_generic() [all …]
|
D | chacha20poly1305.c | 38 __le64 assoclen; member 61 unsigned int assoclen; member 101 req->assoclen + rctx->cryptlen, in poly_verify_tag() 113 req->assoclen + rctx->cryptlen, in poly_copy_tag() 136 src = scatterwalk_ffwd(rctx->src, req->src, req->assoclen); in chacha_decrypt() 139 dst = scatterwalk_ffwd(rctx->dst, req->dst, req->assoclen); in chacha_decrypt() 177 preq->tail.assoclen = cpu_to_le64(rctx->assoclen); in poly_tail() 239 crypt = scatterwalk_ffwd(rctx->src, crypt, req->assoclen); in poly_cipher() 266 padlen = -rctx->assoclen % POLY1305_BLOCK_SIZE; in poly_adpad() 297 ahash_request_set_crypt(&preq->req, req->src, NULL, rctx->assoclen); in poly_ad() [all …]
|
D | ccm.c | 143 if (req->assoclen) in format_input() 175 unsigned int assoclen = req->assoclen; in crypto_ccm_auth() local 190 if (assoclen) { in crypto_ccm_auth() 191 ilen = format_adata(idata, assoclen); in crypto_ccm_auth() 201 ahash_request_set_crypt(ahreq, sg, NULL, assoclen + ilen + 16); in crypto_ccm_auth() 210 ilen = 16 - (assoclen + ilen) % 16; in crypto_ccm_auth() 236 req->assoclen + req->cryptlen, in crypto_ccm_encrypt_done() 270 sg = scatterwalk_ffwd(pctx->src + 1, req->src, req->assoclen); in crypto_ccm_init_crypt() 277 sg = scatterwalk_ffwd(pctx->dst + 1, req->dst, req->assoclen); in crypto_ccm_init_crypt() 620 scatterwalk_map_and_copy(iv + 16, req->src, 0, req->assoclen - 8, 0); in crypto_rfc4309_crypt() [all …]
|
D | echainiv.c | 51 req->assoclen + req->cryptlen, in echainiv_encrypt() 63 aead_request_set_ad(subreq, req->assoclen); in echainiv_encrypt() 69 scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); in echainiv_encrypt() 105 aead_request_set_ad(subreq, req->assoclen + ivsize); in echainiv_decrypt() 107 scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0); in echainiv_decrypt()
|
D | seqiv.c | 74 req->assoclen + req->cryptlen, in seqiv_aead_encrypt() 97 aead_request_set_ad(subreq, req->assoclen + ivsize); in seqiv_aead_encrypt() 100 scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); in seqiv_aead_encrypt() 128 aead_request_set_ad(subreq, req->assoclen + ivsize); in seqiv_aead_decrypt() 130 scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0); in seqiv_aead_decrypt()
|
D | gcm.c | 164 sg = scatterwalk_ffwd(pctx->src + 1, req->src, req->assoclen); in crypto_gcm_init_common() 171 sg = scatterwalk_ffwd(pctx->dst + 1, req->dst, req->assoclen); in crypto_gcm_init_common() 230 lengths.a = cpu_to_be64(req->assoclen * 8); in gcm_hash_len() 347 remain = gcm_remain(req->assoclen); in gcm_hash_assoc_continue() 373 if (req->assoclen) in gcm_hash_init_continue() 375 req->src, req->assoclen, flags) ?: in gcm_hash_init_continue() 417 req->assoclen + req->cryptlen, in gcm_enc_copy_hash() 474 req->assoclen + cryptlen, authsize, 0); in crypto_gcm_verify() 731 scatterwalk_map_and_copy(iv + GCM_AES_IV_SIZE, req->src, 0, req->assoclen - 8, 0); in crypto_rfc4106_crypt() 737 sg_set_buf(rctx->src, iv + GCM_AES_IV_SIZE, req->assoclen - 8); in crypto_rfc4106_crypt() [all …]
|
D | authenc.c | 125 req->assoclen + req->cryptlen, in authenc_geniv_ahash_done() 149 req->assoclen + req->cryptlen); in crypto_authenc_genicv() 157 scatterwalk_map_and_copy(hash, req->dst, req->assoclen + req->cryptlen, in crypto_authenc_genicv() 185 skcipher_request_set_crypt(skreq, req->src, req->dst, req->assoclen, in crypto_authenc_copy_assoc() 205 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_encrypt() 213 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_encrypt() 248 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_decrypt_tail() 252 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_decrypt_tail() 294 req->assoclen + req->cryptlen - authsize); in crypto_authenc_decrypt()
|
/linux-6.6.21/arch/arm64/crypto/ |
D | sm4-ce-ccm-glue.c | 75 if (req->assoclen) in ccm_format_input() 96 u32 assoclen = req->assoclen; in ccm_calculate_auth_mac() local 100 if (assoclen < 0xff00) { in ccm_calculate_auth_mac() 101 aadlen.l = cpu_to_be16(assoclen); in ccm_calculate_auth_mac() 105 put_unaligned_be32(assoclen, &aadlen.h); in ccm_calculate_auth_mac() 115 u32 n = scatterwalk_clamp(&walk, assoclen); in ccm_calculate_auth_mac() 120 n = scatterwalk_clamp(&walk, assoclen); in ccm_calculate_auth_mac() 124 assoclen -= n; in ccm_calculate_auth_mac() 158 scatterwalk_done(&walk, 0, assoclen); in ccm_calculate_auth_mac() 159 } while (assoclen); in ccm_calculate_auth_mac() [all …]
|
D | sm4-ce-gcm-glue.c | 78 u32 assoclen = req->assoclen; in gcm_calculate_auth_mac() local 85 u32 n = scatterwalk_clamp(&walk, assoclen); in gcm_calculate_auth_mac() 90 n = scatterwalk_clamp(&walk, assoclen); in gcm_calculate_auth_mac() 94 assoclen -= n; in gcm_calculate_auth_mac() 127 scatterwalk_done(&walk, 0, assoclen); in gcm_calculate_auth_mac() 128 } while (assoclen); in gcm_calculate_auth_mac() 151 lengths.a = cpu_to_be64(req->assoclen * 8); in gcm_crypt() 159 if (req->assoclen) in gcm_crypt() 211 scatterwalk_map_and_copy(ghash, req->dst, req->assoclen + req->cryptlen, in gcm_encrypt() 233 req->assoclen + req->cryptlen - authsize, in gcm_decrypt()
|
D | ghash-ce-glue.c | 335 static int gcm_encrypt(struct aead_request *req, char *iv, int assoclen) in gcm_encrypt() argument 347 lengths.a = cpu_to_be64(assoclen * 8); in gcm_encrypt() 350 if (assoclen) in gcm_encrypt() 351 gcm_calculate_auth_mac(req, dg, assoclen); in gcm_encrypt() 392 scatterwalk_map_and_copy(tag, req->dst, req->assoclen + req->cryptlen, in gcm_encrypt() 398 static int gcm_decrypt(struct aead_request *req, char *iv, int assoclen) in gcm_decrypt() argument 413 lengths.a = cpu_to_be64(assoclen * 8); in gcm_decrypt() 416 if (assoclen) in gcm_decrypt() 417 gcm_calculate_auth_mac(req, dg, assoclen); in gcm_decrypt() 422 req->assoclen + req->cryptlen - authsize, in gcm_decrypt() [all …]
|
D | aes-ce-ccm-glue.c | 90 if (req->assoclen) in ccm_init_mac() 103 u32 len = req->assoclen; in ccm_calculate_auth_mac() 167 if (req->assoclen) in ccm_encrypt() 193 scatterwalk_map_and_copy(mac, req->dst, req->assoclen + req->cryptlen, in ccm_encrypt() 221 if (req->assoclen) in ccm_decrypt() 251 req->assoclen + req->cryptlen - authsize, in ccm_decrypt()
|
/linux-6.6.21/drivers/crypto/qce/ |
D | aead.c | 54 if (req->assoclen) { in qce_aead_done() 71 totallen = req->cryptlen + req->assoclen; in qce_aead_done() 80 totallen = req->cryptlen + req->assoclen - ctx->authsize; in qce_aead_done() 120 unsigned int assoclen = req->assoclen; in qce_aead_prepare_dst_buf() local 124 totallen = rctx->cryptlen + assoclen; in qce_aead_prepare_dst_buf() 141 if (IS_CCM(rctx->flags) && assoclen) { in qce_aead_prepare_dst_buf() 143 msg_sg = scatterwalk_ffwd(__sg, req->dst, assoclen); in qce_aead_prepare_dst_buf() 146 rctx->assoclen); in qce_aead_prepare_dst_buf() 157 totallen = rctx->cryptlen + rctx->assoclen; in qce_aead_prepare_dst_buf() 191 unsigned int assoclen = rctx->assoclen; in qce_aead_ccm_prepare_buf_assoclen() local [all …]
|
/linux-6.6.21/arch/powerpc/crypto/ |
D | aes-gcm-p10-glue.c | 114 struct Hash_ctx *hash, u8 *assoc, unsigned int assoclen) in gcmp10_init() argument 135 gctx->aadLen = assoclen; in gcmp10_init() 137 if (assoclen) in gcmp10_init() 138 set_aad(gctx, hash, assoc, assoclen); in gcmp10_init() 213 unsigned int assoclen = req->assoclen; in p10_aes_gcm_crypt() local 228 if (req->src->length >= assoclen && req->src->length) { in p10_aes_gcm_crypt() 236 assocmem = kmalloc(assoclen, flags); in p10_aes_gcm_crypt() 241 scatterwalk_map_and_copy(assoc, req->src, 0, assoclen, 0); in p10_aes_gcm_crypt() 245 gcmp10_init(gctx, iv, (unsigned char *) &ctx->enc_key, hash, assoc, assoclen); in p10_aes_gcm_crypt() 289 scatterwalk_map_and_copy(hash->Htable, req->dst, req->assoclen + cryptlen, in p10_aes_gcm_crypt() [all …]
|
/linux-6.6.21/arch/x86/crypto/ |
D | aegis128-aesni-glue.c | 45 unsigned int assoclen); 71 unsigned int assoclen) in crypto_aegis128_aesni_process_ad() argument 78 while (assoclen != 0) { in crypto_aegis128_aesni_process_ad() 79 unsigned int size = scatterwalk_clamp(&walk, assoclen); in crypto_aegis128_aesni_process_ad() 104 assoclen -= size; in crypto_aegis128_aesni_process_ad() 108 scatterwalk_done(&walk, 0, assoclen); in crypto_aegis128_aesni_process_ad() 180 crypto_aegis128_aesni_process_ad(&state, req->src, req->assoclen); in crypto_aegis128_aesni_crypt() 182 crypto_aegis128_aesni_final(&state, tag_xor, req->assoclen, cryptlen); in crypto_aegis128_aesni_crypt() 203 req->assoclen + cryptlen, authsize, 1); in crypto_aegis128_aesni_encrypt() 223 req->assoclen + cryptlen, authsize, 0); in crypto_aegis128_aesni_decrypt()
|
D | aesni-intel_glue.c | 670 unsigned int assoclen, u8 *hash_subkey, in gcmaes_crypt_by_sg() argument 691 if (req->src->length >= assoclen && req->src->length) { in gcmaes_crypt_by_sg() 699 assocmem = kmalloc(assoclen, flags); in gcmaes_crypt_by_sg() 704 scatterwalk_map_and_copy(assoc, req->src, 0, assoclen, 0); in gcmaes_crypt_by_sg() 710 assoclen); in gcmaes_crypt_by_sg() 713 assoclen); in gcmaes_crypt_by_sg() 715 aesni_gcm_init(aes_ctx, data, iv, hash_subkey, assoc, assoclen); in gcmaes_crypt_by_sg() 779 static int gcmaes_encrypt(struct aead_request *req, unsigned int assoclen, in gcmaes_encrypt() argument 787 err = gcmaes_crypt_by_sg(true, req, assoclen, hash_subkey, iv, aes_ctx, in gcmaes_encrypt() 793 req->assoclen + req->cryptlen, in gcmaes_encrypt() [all …]
|
/linux-6.6.21/arch/arm/crypto/ |
D | ghash-ce-glue.c | 490 static int gcm_encrypt(struct aead_request *req, const u8 *iv, u32 assoclen) in gcm_encrypt() argument 510 if (assoclen) in gcm_encrypt() 511 gcm_calculate_auth_mac(req, dg, assoclen); in gcm_encrypt() 543 lengths.a = cpu_to_be64(assoclen * 8); in gcm_encrypt() 574 scatterwalk_map_and_copy(tag, req->dst, req->assoclen + req->cryptlen, in gcm_encrypt() 580 static int gcm_decrypt(struct aead_request *req, const u8 *iv, u32 assoclen) in gcm_decrypt() argument 599 req->assoclen + req->cryptlen - authsize, in gcm_decrypt() 606 if (assoclen) in gcm_decrypt() 607 gcm_calculate_auth_mac(req, dg, assoclen); in gcm_decrypt() 638 lengths.a = cpu_to_be64(assoclen * 8); in gcm_decrypt() [all …]
|
/linux-6.6.21/include/crypto/ |
D | aead.h | 93 unsigned int assoclen; member 547 unsigned int assoclen) in aead_request_set_ad() argument 549 req->assoclen = assoclen; in aead_request_set_ad()
|
D | gcm.h | 54 static inline int crypto_ipsec_check_assoclen(unsigned int assoclen) in crypto_ipsec_check_assoclen() argument 56 switch (assoclen) { in crypto_ipsec_check_assoclen()
|
/linux-6.6.21/drivers/crypto/chelsio/ |
D | chcr_algo.c | 186 authsize, req->assoclen + in chcr_verify_tag() 2411 (req->assoclen > aadmax) || in chcr_aead_need_fallback() 2428 aead_request_set_ad(subreq, req->assoclen); in chcr_aead_fallback() 2472 dnents = sg_nents_xlen(req->dst, req->assoclen + req->cryptlen + in create_authenc_wr() 2475 snents = sg_nents_xlen(req->src, req->assoclen + req->cryptlen, in create_authenc_wr() 2481 reqctx->imm = (transhdr_len + req->assoclen + req->cryptlen) < in create_authenc_wr() 2483 temp = reqctx->imm ? roundup(req->assoclen + req->cryptlen, 16) in create_authenc_wr() 2511 chcr_req->sec_cpl.pldlen = htonl(req->assoclen + IV + req->cryptlen); in create_authenc_wr() 2514 null ? 0 : IV + req->assoclen, in create_authenc_wr() 2515 req->assoclen + IV + 1, in create_authenc_wr() [all …]
|
/linux-6.6.21/drivers/crypto/ccree/ |
D | cc_aead.c | 236 areq->cryptlen, areq->assoclen); in cc_aead_complete() 736 areq_ctx->assoclen, NS_BIT); in cc_set_assoc_desc() 1089 if (areq_ctx->assoclen > 0) in cc_proc_header_desc() 1317 unsigned int assoclen = areq_ctx->assoclen; in validate_data_size() local 1340 if (!IS_ALIGNED(assoclen, sizeof(u32))) in validate_data_size() 1351 if (!IS_ALIGNED(assoclen, DES_BLOCK_SIZE)) in validate_data_size() 1476 if (req_ctx->assoclen > 0) { in cc_ccm() 1568 if (req_ctx->assoclen > 0) in config_ccm_adata() 1579 req_ctx->ccm_hdr_size = format_ccm_a0(a0, req_ctx->assoclen); in config_ccm_adata() 1818 if (req_ctx->assoclen > 0) in cc_gcm() [all …]
|