/Linux-v5.4/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() 170 unsigned int assoclen) in gmac() argument 177 unsigned int nbytes = assoclen; in gmac() 232 atomic64_add(assoclen, &(nx_ctx->stats->aes_bytes)); in gmac() 310 unsigned int assoclen) in gcm_aes_nx_crypt() argument 329 if (assoclen == 0) in gcm_aes_nx_crypt() 332 rc = gmac(req, &desc, assoclen); in gcm_aes_nx_crypt() 340 csbcpb->cpb.aes_gcm.bit_length_aad = assoclen * 8; in gcm_aes_nx_crypt() [all …]
|
/Linux-v5.4/drivers/crypto/ |
D | omap-aes-gcm.c | 58 dd->aead_req->assoclen, dd->total, in omap_aes_gcm_done_task() 64 dd->total + dd->aead_req->assoclen, in omap_aes_gcm_done_task() 90 int alen, clen, cryptlen, assoclen, ret; in omap_aes_gcm_copy_buffers() local 97 assoclen = req->assoclen; in omap_aes_gcm_copy_buffers() 101 assoclen -= 8; in omap_aes_gcm_copy_buffers() 106 alen = ALIGN(assoclen, AES_BLOCK_SIZE); in omap_aes_gcm_copy_buffers() 109 nsg = !!(assoclen && cryptlen); in omap_aes_gcm_copy_buffers() 114 if (assoclen) { in omap_aes_gcm_copy_buffers() 116 ret = omap_crypto_align_sg(&tmp, assoclen, in omap_aes_gcm_copy_buffers() 126 tmp = scatterwalk_ffwd(sg_arr, req->src, req->assoclen); in omap_aes_gcm_copy_buffers() [all …]
|
/Linux-v5.4/crypto/ |
D | authencesn.c | 106 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_genicv_tail() local 113 scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 0); in crypto_authenc_esn_genicv_tail() 116 scatterwalk_map_and_copy(hash, dst, assoclen + cryptlen, authsize, 1); in crypto_authenc_esn_genicv_tail() 140 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_genicv() local 151 scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 1); in crypto_authenc_esn_genicv() 157 ahash_request_set_crypt(ahreq, dst, hash, assoclen + cryptlen); in crypto_authenc_esn_genicv() 199 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_encrypt() local 205 src = scatterwalk_ffwd(areq_ctx->src, req->src, assoclen); in crypto_authenc_esn_encrypt() 209 err = crypto_authenc_esn_copy(req, assoclen); in crypto_authenc_esn_encrypt() 214 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, assoclen); in crypto_authenc_esn_encrypt() [all …]
|
D | chacha20poly1305.c | 40 __le64 assoclen; member 63 unsigned int assoclen; member 103 req->assoclen + rctx->cryptlen, in poly_verify_tag() 115 req->assoclen + rctx->cryptlen, in poly_copy_tag() 138 src = scatterwalk_ffwd(rctx->src, req->src, req->assoclen); in chacha_decrypt() 141 dst = scatterwalk_ffwd(rctx->dst, req->dst, req->assoclen); in chacha_decrypt() 179 preq->tail.assoclen = cpu_to_le64(rctx->assoclen); in poly_tail() 241 crypt = scatterwalk_ffwd(rctx->src, crypt, req->assoclen); in poly_cipher() 268 padlen = -rctx->assoclen % POLY1305_BLOCK_SIZE; in poly_adpad() 299 ahash_request_set_crypt(&preq->req, req->src, NULL, rctx->assoclen); in poly_ad() [all …]
|
D | aegis128-core.c | 283 unsigned int assoclen) in crypto_aegis128_process_ad() argument 290 while (assoclen != 0) { in crypto_aegis128_process_ad() 291 unsigned int size = scatterwalk_clamp(&walk, assoclen); in crypto_aegis128_process_ad() 314 assoclen -= size; in crypto_aegis128_process_ad() 317 scatterwalk_done(&walk, 0, assoclen); in crypto_aegis128_process_ad() 349 u64 assoclen, u64 cryptlen) in crypto_aegis128_final() argument 351 u64 assocbits = assoclen * 8; in crypto_aegis128_final() 403 crypto_aegis128_process_ad(&state, req->src, req->assoclen); in crypto_aegis128_crypt() 405 crypto_aegis128_final(&state, tag_xor, req->assoclen, cryptlen); in crypto_aegis128_crypt() 427 scatterwalk_map_and_copy(tag.bytes, req->dst, req->assoclen + cryptlen, in crypto_aegis128_encrypt() [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 | ccm.c | 151 if (req->assoclen) in format_input() 183 unsigned int assoclen = req->assoclen; in crypto_ccm_auth() local 198 if (assoclen) { in crypto_ccm_auth() 199 ilen = format_adata(idata, assoclen); in crypto_ccm_auth() 209 ahash_request_set_crypt(ahreq, sg, NULL, assoclen + ilen + 16); in crypto_ccm_auth() 218 ilen = 16 - (assoclen + ilen) % 16; in crypto_ccm_auth() 244 req->assoclen + req->cryptlen, in crypto_ccm_encrypt_done() 278 sg = scatterwalk_ffwd(pctx->src + 1, req->src, req->assoclen); in crypto_ccm_init_crypt() 285 sg = scatterwalk_ffwd(pctx->dst + 1, req->dst, req->assoclen); in crypto_ccm_init_crypt() 659 scatterwalk_map_and_copy(iv + 16, req->src, 0, req->assoclen - 8, 0); in crypto_rfc4309_crypt() [all …]
|
D | seqiv.c | 77 req->assoclen + req->cryptlen, in seqiv_aead_encrypt() 100 aead_request_set_ad(subreq, req->assoclen + ivsize); in seqiv_aead_encrypt() 103 scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); in seqiv_aead_encrypt() 131 aead_request_set_ad(subreq, req->assoclen + ivsize); in seqiv_aead_decrypt() 133 scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0); in seqiv_aead_decrypt()
|
D | gcm.c | 170 sg = scatterwalk_ffwd(pctx->src + 1, req->src, req->assoclen); in crypto_gcm_init_common() 177 sg = scatterwalk_ffwd(pctx->dst + 1, req->dst, req->assoclen); in crypto_gcm_init_common() 236 lengths.a = cpu_to_be64(req->assoclen * 8); in gcm_hash_len() 355 remain = gcm_remain(req->assoclen); in gcm_hash_assoc_continue() 381 if (req->assoclen) in gcm_hash_init_continue() 383 req->src, req->assoclen, flags) ?: in gcm_hash_init_continue() 425 req->assoclen + req->cryptlen, in gcm_enc_copy_hash() 482 req->assoclen + cryptlen, authsize, 0); in crypto_gcm_verify() 772 scatterwalk_map_and_copy(iv + GCM_AES_IV_SIZE, req->src, 0, req->assoclen - 8, 0); in crypto_rfc4106_crypt() 778 sg_set_buf(rctx->src, iv + GCM_AES_IV_SIZE, req->assoclen - 8); in crypto_rfc4106_crypt() [all …]
|
D | authenc.c | 135 req->assoclen + req->cryptlen, in authenc_geniv_ahash_done() 159 req->assoclen + req->cryptlen); in crypto_authenc_genicv() 167 scatterwalk_map_and_copy(hash, req->dst, req->assoclen + req->cryptlen, in crypto_authenc_genicv() 196 skcipher_request_set_crypt(skreq, req->src, req->dst, req->assoclen, in crypto_authenc_copy_assoc() 216 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_encrypt() 224 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_encrypt() 259 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_decrypt_tail() 263 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_decrypt_tail() 306 req->assoclen + req->cryptlen - authsize); in crypto_authenc_decrypt()
|
/Linux-v5.4/drivers/crypto/cavium/nitrox/ |
D | nitrox_aead.c | 150 creq->gph.param1 = cpu_to_be16(rctx->cryptlen + rctx->assoclen); in nitrox_set_creq() 151 creq->gph.param2 = cpu_to_be16(rctx->ivsize + rctx->assoclen); in nitrox_set_creq() 201 rctx->assoclen = areq->assoclen; in nitrox_aes_gcm_enc() 202 rctx->srclen = areq->assoclen + areq->cryptlen; in nitrox_aes_gcm_enc() 232 rctx->assoclen = areq->assoclen; in nitrox_aes_gcm_dec() 233 rctx->srclen = areq->cryptlen + areq->assoclen; in nitrox_aes_gcm_dec() 367 unsigned int assoclen = areq->assoclen - GCM_RFC4106_IV_SIZE; in nitrox_rfc4106_set_aead_rctx_sglist() local 370 if (areq->assoclen != 16 && areq->assoclen != 20) in nitrox_rfc4106_set_aead_rctx_sglist() 373 scatterwalk_map_and_copy(rctx->assoc, areq->src, 0, assoclen, 0); in nitrox_rfc4106_set_aead_rctx_sglist() 375 sg_set_buf(rctx->src, rctx->assoc, assoclen); in nitrox_rfc4106_set_aead_rctx_sglist() [all …]
|
/Linux-v5.4/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() 182 crypto_aegis128_aesni_process_ad(&state, req->src, req->assoclen); in crypto_aegis128_aesni_crypt() 184 crypto_aegis128_aesni_final(&state, tag_xor, req->assoclen, cryptlen); in crypto_aegis128_aesni_crypt() 205 req->assoclen + cryptlen, authsize, 1); in crypto_aegis128_aesni_encrypt() 225 req->assoclen + cryptlen, authsize, 0); in crypto_aegis128_aesni_decrypt()
|
D | aesni-intel_glue.c | 704 unsigned int assoclen, u8 *hash_subkey, in gcmaes_crypt_by_sg() argument 737 if (req->src->length >= assoclen && req->src->length && in gcmaes_crypt_by_sg() 744 assocmem = kmalloc(assoclen, GFP_ATOMIC); in gcmaes_crypt_by_sg() 749 scatterwalk_map_and_copy(assoc, req->src, 0, assoclen, 0); in gcmaes_crypt_by_sg() 753 src_sg = scatterwalk_ffwd(src_start, req->src, req->assoclen); in gcmaes_crypt_by_sg() 757 req->assoclen); in gcmaes_crypt_by_sg() 764 hash_subkey, assoc, assoclen); in gcmaes_crypt_by_sg() 820 req->assoclen + req->cryptlen - in gcmaes_crypt_by_sg() 831 req->assoclen + req->cryptlen, in gcmaes_crypt_by_sg() 837 static int gcmaes_encrypt(struct aead_request *req, unsigned int assoclen, in gcmaes_encrypt() argument [all …]
|
/Linux-v5.4/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 | 84 unsigned int assoclen; member 500 unsigned int assoclen) in aead_request_set_ad() argument 502 req->assoclen = assoclen; in aead_request_set_ad()
|
/Linux-v5.4/drivers/crypto/ccree/ |
D | cc_aead.c | 65 return ((req->assoclen == 16) || (req->assoclen == 20)); in valid_assoclen() 746 areq_ctx->assoclen, NS_BIT); in cc_set_assoc_desc() 1099 if (areq_ctx->assoclen > 0) in cc_proc_header_desc() 1327 unsigned int assoclen = areq_ctx->assoclen; in validate_data_size() local 1350 if (!IS_ALIGNED(assoclen, sizeof(u32))) in validate_data_size() 1361 if (!IS_ALIGNED(assoclen, DES_BLOCK_SIZE)) in validate_data_size() 1486 if (req_ctx->assoclen > 0) { in cc_ccm() 1578 if (req_ctx->assoclen > 0) in config_ccm_adata() 1589 req_ctx->ccm_hdr_size = format_ccm_a0(a0, req_ctx->assoclen); in config_ccm_adata() 1621 areq_ctx->assoclen -= CCM_BLOCK_IV_SIZE; in cc_proc_rfc4309_ccm() [all …]
|
D | cc_buffer_mgr.c | 68 u32 skip = areq_ctx->assoclen + req->cryptlen; in cc_copy_mac() 330 unsigned int assoclen) in cc_set_aead_conf_buf() argument 346 if (assoclen > 0) { in cc_set_aead_conf_buf() 556 areq_ctx->assoclen, req->cryptlen); in cc_unmap_aead_request() 643 unsigned int size_of_assoc = areq_ctx->assoclen; in cc_aead_chain_assoc() 654 if (areq_ctx->assoclen == 0) { in cc_aead_chain_assoc() 698 areq_ctx->assoclen, 0, is_last, in cc_aead_chain_assoc() 857 unsigned int size_for_map = areq_ctx->assoclen + req->cryptlen; in cc_aead_chain_data() 861 u32 size_to_skip = areq_ctx->assoclen; in cc_aead_chain_data() 904 size_for_map = areq_ctx->assoclen + req->cryptlen; in cc_aead_chain_data() [all …]
|
/Linux-v5.4/drivers/crypto/chelsio/ |
D | chcr_algo.c | 191 authsize, req->assoclen + in chcr_verify_tag() 2300 (req->assoclen > aadmax) || in chcr_aead_need_fallback() 2317 aead_request_set_ad(subreq, req->assoclen); in chcr_aead_fallback() 2357 dnents = sg_nents_xlen(req->dst, req->assoclen + req->cryptlen + in create_authenc_wr() 2360 snents = sg_nents_xlen(req->src, req->assoclen + req->cryptlen, in create_authenc_wr() 2366 reqctx->imm = (transhdr_len + req->assoclen + req->cryptlen) < in create_authenc_wr() 2368 temp = reqctx->imm ? roundup(req->assoclen + req->cryptlen, 16) in create_authenc_wr() 2396 chcr_req->sec_cpl.pldlen = htonl(req->assoclen + IV + req->cryptlen); in create_authenc_wr() 2399 null ? 0 : IV + req->assoclen, in create_authenc_wr() 2400 req->assoclen + IV + 1, in create_authenc_wr() [all …]
|
/Linux-v5.4/arch/arm64/crypto/ |
D | aes-ce-ccm-glue.c | 98 if (req->assoclen) in ccm_init_mac() 146 u32 len = req->assoclen; in ccm_calculate_auth_mac() 242 if (req->assoclen) in ccm_encrypt() 279 scatterwalk_map_and_copy(mac, req->dst, req->assoclen + req->cryptlen, in ccm_encrypt() 300 if (req->assoclen) in ccm_decrypt() 339 req->assoclen + req->cryptlen - authsize, in ccm_decrypt()
|
D | ghash-ce-glue.c | 371 u32 len = req->assoclen; in gcm_calculate_auth_mac() 407 lengths.a = cpu_to_be64(req->assoclen * 8); in gcm_final() 431 if (req->assoclen) in gcm_encrypt() 532 scatterwalk_map_and_copy(tag, req->dst, req->assoclen + req->cryptlen, in gcm_encrypt() 551 if (req->assoclen) in gcm_decrypt() 668 req->assoclen + req->cryptlen - authsize, in gcm_decrypt()
|
/Linux-v5.4/net/ipv6/ |
D | esp6.c | 313 int assoclen; in esp6_output_tail() local 323 assoclen = sizeof(struct ip_esp_hdr); in esp6_output_tail() 328 assoclen += sizeof(__be32); in esp6_output_tail() 354 assoclen + ivlen + esp->clen + alen); in esp6_output_tail() 382 assoclen + ivlen + esp->clen + alen); in esp6_output_tail() 393 aead_request_set_ad(req, assoclen); in esp6_output_tail() 599 int assoclen; in esp6_input() local 617 assoclen = sizeof(struct ip_esp_hdr); in esp6_input() 622 assoclen += seqhilen; in esp6_input() 673 aead_request_set_ad(req, assoclen); in esp6_input()
|
/Linux-v5.4/net/ipv4/ |
D | esp4.c | 371 int assoclen; in esp_output_tail() local 381 assoclen = sizeof(struct ip_esp_hdr); in esp_output_tail() 386 assoclen += sizeof(__be32); in esp_output_tail() 413 assoclen + ivlen + esp->clen + alen); in esp_output_tail() 441 assoclen + ivlen + esp->clen + alen); in esp_output_tail() 452 aead_request_set_ad(req, assoclen); in esp_output_tail() 704 int assoclen; in esp_input() local 718 assoclen = sizeof(struct ip_esp_hdr); in esp_input() 723 assoclen += seqhilen; in esp_input() 774 aead_request_set_ad(req, assoclen); in esp_input()
|
/Linux-v5.4/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.4/drivers/crypto/inside-secure/ |
D | safexcel_cipher.c | 147 u32 cryptlen, u32 assoclen, u32 digestsize) in safexcel_aead_token() argument 186 token[6].packet_length = assoclen; in safexcel_aead_token() 226 ((assoclen > 0) << 1); in safexcel_aead_token() 232 cbcmaciv[0] |= ((assoclen > 0) << 6) | ((digestsize - 2) << 2); in safexcel_aead_token() 239 if (assoclen) { in safexcel_aead_token() 240 *aadlen = cpu_to_le32(cpu_to_be16(assoclen)); in safexcel_aead_token() 241 assoclen += 2; in safexcel_aead_token() 248 assoclen &= 15; in safexcel_aead_token() 249 token[7].packet_length = assoclen ? 16 - assoclen : 0; in safexcel_aead_token() 551 unsigned int cryptlen, unsigned int assoclen, in safexcel_send_req() argument [all …]
|