/Linux-v5.10/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 148 if (assoclen) in generate_b0() 161 unsigned int assoclen, in generate_pat() argument 188 if (!assoclen) { in generate_pat() 190 } else if (assoclen <= 14) { in generate_pat() 196 iauth_len = assoclen; in generate_pat() 197 } else if (assoclen <= 65280) { in generate_pat() 211 rc = generate_b0(iv, assoclen, authsize, nbytes, b0); in generate_pat() 221 if (assoclen <= 65280) { in generate_pat() 222 *(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-v5.10/drivers/crypto/ |
D | omap-aes-gcm.c | 61 dd->aead_req->assoclen, dd->total, in omap_aes_gcm_done_task() 67 dd->total + dd->aead_req->assoclen, in omap_aes_gcm_done_task() 91 int alen, clen, cryptlen, assoclen, ret; in omap_aes_gcm_copy_buffers() local 98 assoclen = req->assoclen; in omap_aes_gcm_copy_buffers() 102 assoclen -= 8; in omap_aes_gcm_copy_buffers() 107 alen = ALIGN(assoclen, AES_BLOCK_SIZE); in omap_aes_gcm_copy_buffers() 110 nsg = !!(assoclen && cryptlen); in omap_aes_gcm_copy_buffers() 115 if (assoclen) { in omap_aes_gcm_copy_buffers() 117 ret = omap_crypto_align_sg(&tmp, assoclen, in omap_aes_gcm_copy_buffers() 129 tmp = scatterwalk_ffwd(sg_arr, req->src, req->assoclen); in omap_aes_gcm_copy_buffers() [all …]
|
/Linux-v5.10/drivers/crypto/cavium/nitrox/ |
D | nitrox_aead.c | 167 creq->gph.param1 = cpu_to_be16(rctx->cryptlen + rctx->assoclen); in nitrox_set_creq() 168 creq->gph.param2 = cpu_to_be16(rctx->ivsize + rctx->assoclen); in nitrox_set_creq() 206 static inline bool nitrox_aes_gcm_assoclen_supported(unsigned int assoclen) in nitrox_aes_gcm_assoclen_supported() argument 208 if (assoclen <= 512) in nitrox_aes_gcm_assoclen_supported() 223 if (!nitrox_aes_gcm_assoclen_supported(areq->assoclen)) in nitrox_aes_gcm_enc() 229 rctx->assoclen = areq->assoclen; in nitrox_aes_gcm_enc() 230 rctx->srclen = areq->assoclen + areq->cryptlen; in nitrox_aes_gcm_enc() 257 if (!nitrox_aes_gcm_assoclen_supported(areq->assoclen)) in nitrox_aes_gcm_dec() 263 rctx->assoclen = areq->assoclen; in nitrox_aes_gcm_dec() 264 rctx->srclen = areq->cryptlen + areq->assoclen; in nitrox_aes_gcm_dec() [all …]
|
/Linux-v5.10/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() 130 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_genicv() local 141 scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 1); in crypto_authenc_esn_genicv() 147 ahash_request_set_crypt(ahreq, dst, hash, assoclen + cryptlen); in crypto_authenc_esn_genicv() 189 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_encrypt() local 195 src = scatterwalk_ffwd(areq_ctx->src, req->src, assoclen); in crypto_authenc_esn_encrypt() 199 err = crypto_authenc_esn_copy(req, assoclen); in crypto_authenc_esn_encrypt() 204 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, assoclen); in crypto_authenc_esn_encrypt() [all …]
|
D | aegis128-core.c | 72 u64 assoclen, u64 cryptlen); 282 unsigned int assoclen) in crypto_aegis128_process_ad() argument 289 while (assoclen != 0) { in crypto_aegis128_process_ad() 290 unsigned int size = scatterwalk_clamp(&walk, assoclen); in crypto_aegis128_process_ad() 313 assoclen -= size; in crypto_aegis128_process_ad() 316 scatterwalk_done(&walk, 0, assoclen); in crypto_aegis128_process_ad() 350 u64 assoclen, u64 cryptlen) in crypto_aegis128_final() argument 352 u64 assocbits = assoclen * 8; in crypto_aegis128_final() 405 crypto_aegis128_process_ad(&state, req->src, req->assoclen); in crypto_aegis128_encrypt() 408 crypto_aegis128_final_simd(&state, &tag, req->assoclen, in crypto_aegis128_encrypt() [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 | 142 if (req->assoclen) in format_input() 174 unsigned int assoclen = req->assoclen; in crypto_ccm_auth() local 189 if (assoclen) { in crypto_ccm_auth() 190 ilen = format_adata(idata, assoclen); in crypto_ccm_auth() 200 ahash_request_set_crypt(ahreq, sg, NULL, assoclen + ilen + 16); in crypto_ccm_auth() 209 ilen = 16 - (assoclen + ilen) % 16; in crypto_ccm_auth() 235 req->assoclen + req->cryptlen, in crypto_ccm_encrypt_done() 269 sg = scatterwalk_ffwd(pctx->src + 1, req->src, req->assoclen); in crypto_ccm_init_crypt() 276 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 | aegis128-neon.c | 17 void crypto_aegis128_final_neon(void *state, void *tag_xor, uint64_t assoclen, 65 u64 assoclen, u64 cryptlen) in crypto_aegis128_final_simd() argument 68 crypto_aegis128_final_neon(state, tag_xor, assoclen, cryptlen); in crypto_aegis128_final_simd()
|
D | seqiv.c | 75 req->assoclen + req->cryptlen, in seqiv_aead_encrypt() 98 aead_request_set_ad(subreq, req->assoclen + ivsize); in seqiv_aead_encrypt() 101 scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); in seqiv_aead_encrypt() 129 aead_request_set_ad(subreq, req->assoclen + ivsize); in seqiv_aead_decrypt() 131 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() 349 remain = gcm_remain(req->assoclen); in gcm_hash_assoc_continue() 375 if (req->assoclen) in gcm_hash_init_continue() 377 req->src, req->assoclen, flags) ?: in gcm_hash_init_continue() 419 req->assoclen + req->cryptlen, in gcm_enc_copy_hash() 476 req->assoclen + cryptlen, authsize, 0); in crypto_gcm_verify() 733 scatterwalk_map_and_copy(iv + GCM_AES_IV_SIZE, req->src, 0, req->assoclen - 8, 0); in crypto_rfc4106_crypt() 739 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() 186 skcipher_request_set_crypt(skreq, req->src, req->dst, req->assoclen, in crypto_authenc_copy_assoc() 206 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_encrypt() 214 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_encrypt() 249 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_decrypt_tail() 253 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_decrypt_tail() 296 req->assoclen + req->cryptlen - authsize); in crypto_authenc_decrypt()
|
/Linux-v5.10/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 | 683 unsigned int assoclen, u8 *hash_subkey, in gcmaes_crypt_by_sg() argument 712 if (req->src->length >= assoclen && req->src->length && in gcmaes_crypt_by_sg() 719 assocmem = kmalloc(assoclen, GFP_ATOMIC); in gcmaes_crypt_by_sg() 724 scatterwalk_map_and_copy(assoc, req->src, 0, assoclen, 0); in gcmaes_crypt_by_sg() 728 src_sg = scatterwalk_ffwd(src_start, req->src, req->assoclen); in gcmaes_crypt_by_sg() 732 req->assoclen); in gcmaes_crypt_by_sg() 739 hash_subkey, assoc, assoclen); in gcmaes_crypt_by_sg() 795 req->assoclen + req->cryptlen - in gcmaes_crypt_by_sg() 806 req->assoclen + req->cryptlen, in gcmaes_crypt_by_sg() 812 static int gcmaes_encrypt(struct aead_request *req, unsigned int assoclen, in gcmaes_encrypt() argument [all …]
|
/Linux-v5.10/include/crypto/ |
D | gcm.h | 51 static inline int crypto_ipsec_check_assoclen(unsigned int assoclen) in crypto_ipsec_check_assoclen() argument 53 switch (assoclen) { in crypto_ipsec_check_assoclen()
|
D | aead.h | 90 unsigned int assoclen; member 516 unsigned int assoclen) in aead_request_set_ad() argument 518 req->assoclen = assoclen; in aead_request_set_ad()
|
/Linux-v5.10/drivers/crypto/chelsio/ |
D | chcr_algo.c | 190 authsize, req->assoclen + in chcr_verify_tag() 2412 (req->assoclen > aadmax) || in chcr_aead_need_fallback() 2429 aead_request_set_ad(subreq, req->assoclen); in chcr_aead_fallback() 2471 dnents = sg_nents_xlen(req->dst, req->assoclen + req->cryptlen + in create_authenc_wr() 2474 snents = sg_nents_xlen(req->src, req->assoclen + req->cryptlen, in create_authenc_wr() 2480 reqctx->imm = (transhdr_len + req->assoclen + req->cryptlen) < in create_authenc_wr() 2482 temp = reqctx->imm ? roundup(req->assoclen + req->cryptlen, 16) in create_authenc_wr() 2510 chcr_req->sec_cpl.pldlen = htonl(req->assoclen + IV + req->cryptlen); in create_authenc_wr() 2513 null ? 0 : IV + req->assoclen, in create_authenc_wr() 2514 req->assoclen + IV + 1, in create_authenc_wr() [all …]
|
/Linux-v5.10/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 …]
|
D | cc_buffer_mgr.c | 56 u32 skip = req->assoclen + req->cryptlen; in cc_copy_mac() 284 unsigned int assoclen) in cc_set_aead_conf_buf() argument 300 if (assoclen > 0) { in cc_set_aead_conf_buf() 508 areq_ctx->assoclen, req->cryptlen); in cc_unmap_aead_request() 590 if (areq_ctx->assoclen == 0) { in cc_aead_chain_assoc() 600 mapped_nents = sg_nents_for_len(req->src, areq_ctx->assoclen); in cc_aead_chain_assoc() 634 areq_ctx->assoclen, 0, is_last, in cc_aead_chain_assoc() 793 unsigned int size_for_map = req->assoclen + req->cryptlen; in cc_aead_chain_data() 795 u32 size_to_skip = req->assoclen; in cc_aead_chain_data() 832 size_for_map = req->assoclen + req->cryptlen; in cc_aead_chain_data() [all …]
|
/Linux-v5.10/arch/arm64/crypto/ |
D | aes-ce-ccm-glue.c | 92 if (req->assoclen) in ccm_init_mac() 140 u32 len = req->assoclen; in ccm_calculate_auth_mac() 236 if (req->assoclen) in ccm_encrypt() 273 scatterwalk_map_and_copy(mac, req->dst, req->assoclen + req->cryptlen, in ccm_encrypt() 294 if (req->assoclen) in ccm_decrypt() 333 req->assoclen + req->cryptlen - authsize, in ccm_decrypt()
|
D | ghash-ce-glue.c | 311 u32 len = req->assoclen; in gcm_calculate_auth_mac() 354 lengths.a = cpu_to_be64(req->assoclen * 8); in gcm_encrypt() 357 if (req->assoclen) in gcm_encrypt() 448 scatterwalk_map_and_copy(tag, req->dst, req->assoclen + req->cryptlen, in gcm_encrypt() 468 lengths.a = cpu_to_be64(req->assoclen * 8); in gcm_decrypt() 471 if (req->assoclen) in gcm_decrypt() 563 req->assoclen + req->cryptlen - authsize, in gcm_decrypt()
|
/Linux-v5.10/net/mac802154/ |
D | llsec.c | 654 int authlen, assoclen, datalen, rc; in llsec_do_encrypt_auth() local 665 assoclen = skb->mac_len; in llsec_do_encrypt_auth() 672 sg_init_one(&sg, skb_mac_header(skb), assoclen + datalen + authlen); in llsec_do_encrypt_auth() 675 assoclen += datalen; in llsec_do_encrypt_auth() 681 aead_request_set_ad(req, assoclen); in llsec_do_encrypt_auth() 860 int authlen, datalen, assoclen, rc; in llsec_do_decrypt_auth() local 871 assoclen = skb->mac_len; in llsec_do_decrypt_auth() 876 sg_init_one(&sg, skb_mac_header(skb), assoclen + datalen); in llsec_do_decrypt_auth() 879 assoclen += datalen - authlen; in llsec_do_decrypt_auth() 885 aead_request_set_ad(req, assoclen); in llsec_do_decrypt_auth()
|
/Linux-v5.10/net/ipv4/ |
D | esp4.c | 542 int assoclen; in esp_output_tail() local 552 assoclen = sizeof(struct ip_esp_hdr); in esp_output_tail() 557 assoclen += sizeof(__be32); in esp_output_tail() 584 assoclen + ivlen + esp->clen + alen); in esp_output_tail() 612 assoclen + ivlen + esp->clen + alen); in esp_output_tail() 623 aead_request_set_ad(req, assoclen); in esp_output_tail() 894 int assoclen; in esp_input() local 908 assoclen = sizeof(struct ip_esp_hdr); in esp_input() 913 assoclen += seqhilen; in esp_input() 964 aead_request_set_ad(req, assoclen); in esp_input()
|
/Linux-v5.10/net/ipv6/ |
D | esp6.c | 576 int assoclen; in esp6_output_tail() local 586 assoclen = sizeof(struct ip_esp_hdr); in esp6_output_tail() 591 assoclen += sizeof(__be32); in esp6_output_tail() 618 assoclen + ivlen + esp->clen + alen); in esp6_output_tail() 646 assoclen + ivlen + esp->clen + alen); in esp6_output_tail() 657 aead_request_set_ad(req, assoclen); in esp6_output_tail() 930 int assoclen; in esp6_input() local 948 assoclen = sizeof(struct ip_esp_hdr); in esp6_input() 953 assoclen += seqhilen; in esp6_input() 1004 aead_request_set_ad(req, assoclen); in esp6_input()
|