/linux-6.1.9/crypto/ |
D | authencesn.c | 97 unsigned int cryptlen = req->cryptlen; 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() 131 unsigned int cryptlen = req->cryptlen; 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() 190 unsigned int cryptlen = req->cryptlen; in crypto_authenc_esn_encrypt() local 210 skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv); in crypto_authenc_esn_encrypt() 231 unsigned int cryptlen = req->cryptlen - authsize; in crypto_authenc_esn_decrypt_tail() local 242 scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 0); in crypto_authenc_esn_decrypt_tail() [all …]
|
D | aegis128-core.c | 346 u64 assoclen, u64 cryptlen) in crypto_aegis128_final() argument 349 u64 cryptbits = cryptlen * 8; in crypto_aegis128_final() 394 unsigned int cryptlen = req->cryptlen; in crypto_aegis128_encrypt_generic() local 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() 416 unsigned int cryptlen = req->cryptlen - authsize; in crypto_aegis128_decrypt_generic() local 421 scatterwalk_map_and_copy(tag.bytes, req->src, req->assoclen + cryptlen, in crypto_aegis128_decrypt_generic() 429 crypto_aegis128_final(&state, &tag, req->assoclen, cryptlen); in crypto_aegis128_decrypt_generic() 455 unsigned int cryptlen = req->cryptlen; in crypto_aegis128_encrypt_simd() local 467 crypto_aegis128_final_simd(&state, &tag, req->assoclen, cryptlen, 0); in crypto_aegis128_encrypt_simd() [all …]
|
D | keywrap.c | 130 u64 t = 6 * ((req->cryptlen) >> 3); in crypto_kw_decrypt() 138 if (req->cryptlen < (2 * SEMIBSIZE) || req->cryptlen % SEMIBSIZE) in crypto_kw_decrypt() 154 unsigned int nbytes = req->cryptlen; in crypto_kw_decrypt() 208 if (req->cryptlen < (2 * SEMIBSIZE) || req->cryptlen % SEMIBSIZE) in crypto_kw_encrypt() 227 unsigned int nbytes = req->cryptlen; in crypto_kw_encrypt()
|
D | chacha20poly1305.c | 39 __le64 cryptlen; member 59 unsigned int cryptlen; member 101 req->assoclen + rctx->cryptlen, in poly_verify_tag() 113 req->assoclen + rctx->cryptlen, in poly_copy_tag() 131 if (rctx->cryptlen == 0) in chacha_decrypt() 145 rctx->cryptlen, creq->iv); in chacha_decrypt() 158 if (rctx->cryptlen == req->cryptlen) /* encrypting */ in poly_tail_continue() 178 preq->tail.cryptlen = cpu_to_le64(rctx->cryptlen); in poly_tail() 207 padlen = -rctx->cryptlen % POLY1305_BLOCK_SIZE; in poly_cipherpad() 236 if (rctx->cryptlen == req->cryptlen) /* encrypting */ in poly_cipher() [all …]
|
D | ccm.c | 128 unsigned int cryptlen) in format_input() argument 146 return set_msg_len(info + 16 - l, cryptlen, l); in format_input() 169 unsigned int cryptlen) in crypto_ccm_auth() argument 182 err = format_input(odata, req, cryptlen); in crypto_ccm_auth() 218 cryptlen += ilen; in crypto_ccm_auth() 221 ahash_request_set_crypt(ahreq, plain, pctx->odata, cryptlen); in crypto_ccm_auth() 236 req->assoclen + req->cryptlen, in crypto_ccm_encrypt_done() 292 unsigned int cryptlen = req->cryptlen; in crypto_ccm_encrypt() local 301 err = crypto_ccm_auth(req, sg_next(pctx->src), cryptlen); in crypto_ccm_encrypt() 312 skcipher_request_set_crypt(skreq, pctx->src, dst, cryptlen + 16, iv); in crypto_ccm_encrypt() [all …]
|
D | gcm.c | 58 unsigned int cryptlen; member 178 unsigned int cryptlen) in crypto_gcm_init_crypt() argument 190 cryptlen + sizeof(pctx->auth_tag), in crypto_gcm_init_crypt() 231 lengths.b = cpu_to_be64(gctx->cryptlen * 8); in gcm_hash_len() 292 remain = gcm_remain(gctx->cryptlen); in gcm_hash_crypt_continue() 321 if (gctx->cryptlen) in gcm_hash_assoc_remain_continue() 323 gctx->src, gctx->cryptlen, flags) ?: in gcm_hash_assoc_remain_continue() 419 req->assoclen + req->cryptlen, in gcm_enc_copy_hash() 430 gctx->cryptlen = req->cryptlen; in gcm_encrypt_continue() 458 crypto_gcm_init_crypt(req, req->cryptlen); in crypto_gcm_encrypt() [all …]
|
D | echainiv.c | 37 if (req->cryptlen < ivsize) in echainiv_encrypt() 51 req->assoclen + req->cryptlen, in echainiv_encrypt() 62 req->cryptlen, info); in echainiv_encrypt() 94 if (req->cryptlen < ivsize) in echainiv_decrypt() 104 req->cryptlen - ivsize, req->iv); in echainiv_decrypt()
|
D | aead.c | 87 unsigned int cryptlen = req->cryptlen; in crypto_aead_encrypt() local 95 crypto_stats_aead_encrypt(cryptlen, alg, ret); in crypto_aead_encrypt() 104 unsigned int cryptlen = req->cryptlen; in crypto_aead_decrypt() local 110 else if (req->cryptlen < crypto_aead_authsize(aead)) in crypto_aead_decrypt() 114 crypto_stats_aead_decrypt(cryptlen, alg, ret); in crypto_aead_decrypt()
|
D | aegis128-neon.c | 19 unsigned int cryptlen, 68 unsigned int cryptlen, in crypto_aegis128_final_simd() argument 74 ret = crypto_aegis128_final_neon(state, tag_xor, assoclen, cryptlen, in crypto_aegis128_final_simd()
|
D | seqiv.c | 59 if (req->cryptlen < ivsize) in seqiv_aead_encrypt() 75 req->assoclen + req->cryptlen, in seqiv_aead_encrypt() 97 req->cryptlen - ivsize, info); in seqiv_aead_encrypt() 118 if (req->cryptlen < ivsize + crypto_aead_authsize(geniv)) in seqiv_aead_decrypt() 128 req->cryptlen - ivsize, req->iv); in seqiv_aead_decrypt()
|
D | xts.c | 87 const bool cts = (req->cryptlen % XTS_BLOCK_SIZE); in xts_xor_tweak() 164 int offset = req->cryptlen & ~(XTS_BLOCK_SIZE - 1); in xts_cts_final() 167 int tail = req->cryptlen % XTS_BLOCK_SIZE; in xts_cts_final() 209 if (!err && unlikely(req->cryptlen % XTS_BLOCK_SIZE)) { in xts_encrypt_done() 229 if (!err && unlikely(req->cryptlen % XTS_BLOCK_SIZE)) { in xts_decrypt_done() 247 if (req->cryptlen < XTS_BLOCK_SIZE) in xts_init_crypt() 253 req->cryptlen & ~(XTS_BLOCK_SIZE - 1), NULL); in xts_init_crypt() 272 if (err || likely((req->cryptlen % XTS_BLOCK_SIZE) == 0)) in xts_encrypt() 289 if (err || likely((req->cryptlen % XTS_BLOCK_SIZE) == 0)) in xts_decrypt()
|
/linux-6.1.9/arch/x86/crypto/ |
D | aegis128-aesni-glue.c | 44 void *state, void *tag_xor, unsigned int cryptlen, 167 unsigned int cryptlen, in crypto_aegis128_aesni_crypt() argument 182 crypto_aegis128_aesni_final(&state, tag_xor, req->assoclen, cryptlen); in crypto_aegis128_aesni_crypt() 198 unsigned int cryptlen = req->cryptlen; in crypto_aegis128_aesni_encrypt() local 200 crypto_aegis128_aesni_crypt(req, &tag, cryptlen, &OPS); in crypto_aegis128_aesni_encrypt() 203 req->assoclen + cryptlen, authsize, 1); in crypto_aegis128_aesni_encrypt() 220 unsigned int cryptlen = req->cryptlen - authsize; in crypto_aegis128_aesni_decrypt() local 223 req->assoclen + cryptlen, authsize, 0); in crypto_aegis128_aesni_decrypt() 225 crypto_aegis128_aesni_crypt(req, &tag, cryptlen, &OPS); in crypto_aegis128_aesni_decrypt()
|
/linux-6.1.9/drivers/crypto/allwinner/sun8i-ce/ |
D | sun8i-ce-cipher.c | 34 if (sg_nents_for_len(areq->src, areq->cryptlen) > MAX_SG || in sun8i_ce_cipher_need_fallback() 35 sg_nents_for_len(areq->dst, areq->cryptlen) > MAX_SG) { in sun8i_ce_cipher_need_fallback() 40 if (areq->cryptlen < crypto_skcipher_ivsize(tfm)) { in sun8i_ce_cipher_need_fallback() 45 if (areq->cryptlen == 0) { in sun8i_ce_cipher_need_fallback() 50 if (areq->cryptlen % 16) { in sun8i_ce_cipher_need_fallback() 55 len = areq->cryptlen; in sun8i_ce_cipher_need_fallback() 71 len = areq->cryptlen; in sun8i_ce_cipher_need_fallback() 107 areq->cryptlen, areq->iv); in sun8i_ce_cipher_fallback() 133 int ns = sg_nents_for_len(areq->src, areq->cryptlen); in sun8i_ce_cipher_prepare() 134 int nd = sg_nents_for_len(areq->dst, areq->cryptlen); in sun8i_ce_cipher_prepare() [all …]
|
/linux-6.1.9/arch/arm/crypto/ |
D | aes-ce-glue.c | 271 int cbc_blocks = DIV_ROUND_UP(req->cryptlen, AES_BLOCK_SIZE) - 2; in cts_cbc_encrypt() 282 if (req->cryptlen <= AES_BLOCK_SIZE) { in cts_cbc_encrypt() 283 if (req->cryptlen < AES_BLOCK_SIZE) in cts_cbc_encrypt() 298 if (req->cryptlen == AES_BLOCK_SIZE) in cts_cbc_encrypt() 301 dst = src = scatterwalk_ffwd(sg_src, req->src, subreq.cryptlen); in cts_cbc_encrypt() 304 subreq.cryptlen); in cts_cbc_encrypt() 309 req->cryptlen - cbc_blocks * AES_BLOCK_SIZE, in cts_cbc_encrypt() 329 int cbc_blocks = DIV_ROUND_UP(req->cryptlen, AES_BLOCK_SIZE) - 2; in cts_cbc_decrypt() 340 if (req->cryptlen <= AES_BLOCK_SIZE) { in cts_cbc_decrypt() 341 if (req->cryptlen < AES_BLOCK_SIZE) in cts_cbc_decrypt() [all …]
|
/linux-6.1.9/drivers/crypto/qce/ |
D | aead.c | 71 totallen = req->cryptlen + req->assoclen; in qce_aead_done() 80 totallen = req->cryptlen + req->assoclen - ctx->authsize; in qce_aead_done() 124 totallen = rctx->cryptlen + assoclen; in qce_aead_prepare_dst_buf() 152 sg = qce_sgtable_add(&rctx->dst_tbl, msg_sg, rctx->cryptlen); in qce_aead_prepare_dst_buf() 157 totallen = rctx->cryptlen + rctx->assoclen; in qce_aead_prepare_dst_buf() 192 unsigned int adata_header_len, cryptlen, totallen; in qce_aead_ccm_prepare_buf_assoclen() local 198 cryptlen = rctx->cryptlen + ctx->authsize; in qce_aead_ccm_prepare_buf_assoclen() 200 cryptlen = rctx->cryptlen; in qce_aead_ccm_prepare_buf_assoclen() 201 totallen = cryptlen + req->assoclen; in qce_aead_ccm_prepare_buf_assoclen() 257 sg = qce_sgtable_add(&rctx->src_tbl, msg_sg, cryptlen); in qce_aead_ccm_prepare_buf_assoclen() [all …]
|
D | skcipher.c | 79 rctx->cryptlen = req->cryptlen; in qce_skcipher_async_req_handle() 85 rctx->src_nents = sg_nents_for_len(req->src, req->cryptlen); in qce_skcipher_async_req_handle() 87 rctx->dst_nents = sg_nents_for_len(req->dst, req->cryptlen); in qce_skcipher_async_req_handle() 110 sg = qce_sgtable_add(&rctx->dst_tbl, req->dst, req->cryptlen); in qce_skcipher_async_req_handle() 271 if (!req->cryptlen) in qce_skcipher_crypt() 279 if (!IS_ALIGNED(req->cryptlen, blocksize)) in qce_skcipher_crypt() 292 (IS_XTS(rctx->flags) && ((req->cryptlen <= aes_sw_max_len) || in qce_skcipher_crypt() 293 (req->cryptlen > QCE_SECTOR_SIZE && in qce_skcipher_crypt() 294 req->cryptlen % QCE_SECTOR_SIZE))))) { in qce_skcipher_crypt() 301 req->dst, req->cryptlen, req->iv); in qce_skcipher_crypt()
|
/linux-6.1.9/drivers/crypto/allwinner/sun8i-ss/ |
D | sun8i-ss-cipher.c | 33 if (areq->cryptlen == 0 || areq->cryptlen % 16) { in sun8i_ss_need_fallback() 38 if (sg_nents_for_len(areq->src, areq->cryptlen) > 8 || in sun8i_ss_need_fallback() 39 sg_nents_for_len(areq->dst, areq->cryptlen) > 8) { in sun8i_ss_need_fallback() 44 len = areq->cryptlen; in sun8i_ss_need_fallback() 59 len = areq->cryptlen; in sun8i_ss_need_fallback() 107 areq->cryptlen, areq->iv); in sun8i_ss_cipher_fallback() 123 unsigned int len = areq->cryptlen; in sun8i_ss_setup_ivs() 132 offset = areq->cryptlen - ivsize; in sun8i_ss_setup_ivs() 192 int nsgs = sg_nents_for_len(areq->src, areq->cryptlen); in sun8i_ss_cipher() 193 int nsgd = sg_nents_for_len(areq->dst, areq->cryptlen); in sun8i_ss_cipher() [all …]
|
/linux-6.1.9/drivers/crypto/ |
D | omap-aes-gcm.c | 91 int alen, clen, cryptlen, assoclen, ret; in omap_aes_gcm_copy_buffers() local 99 cryptlen = req->cryptlen; in omap_aes_gcm_copy_buffers() 105 cryptlen -= authlen; in omap_aes_gcm_copy_buffers() 108 clen = ALIGN(cryptlen, AES_BLOCK_SIZE); in omap_aes_gcm_copy_buffers() 110 nsg = !!(assoclen && cryptlen); in omap_aes_gcm_copy_buffers() 128 if (cryptlen) { in omap_aes_gcm_copy_buffers() 134 ret = omap_crypto_align_sg(&tmp, cryptlen, in omap_aes_gcm_copy_buffers() 146 dd->total = cryptlen; in omap_aes_gcm_copy_buffers() 159 if (cryptlen) { in omap_aes_gcm_copy_buffers() 160 ret = omap_crypto_align_sg(&dd->out_sg, cryptlen, in omap_aes_gcm_copy_buffers() [all …]
|
/linux-6.1.9/drivers/crypto/allwinner/sun4i-ss/ |
D | sun4i-ss-cipher.c | 30 unsigned int ileft = areq->cryptlen; in sun4i_ss_opti_poll() 31 unsigned int oleft = areq->cryptlen; in sun4i_ss_opti_poll() 41 if (!areq->cryptlen) in sun4i_ss_opti_poll() 51 areq->cryptlen - ivsize, ivsize, 0); in sun4i_ss_opti_poll() 57 algt->stat_bytes += areq->cryptlen; in sun4i_ss_opti_poll() 74 ileft = areq->cryptlen / 4; in sun4i_ss_opti_poll() 75 oleft = areq->cryptlen / 4; in sun4i_ss_opti_poll() 137 scatterwalk_map_and_copy(areq->iv, areq->dst, areq->cryptlen - ivsize, in sun4i_ss_opti_poll() 166 areq->cryptlen, areq->iv); in sun4i_ss_cipher_poll_fallback() 196 unsigned int ileft = areq->cryptlen; in sun4i_ss_cipher_poll() [all …]
|
/linux-6.1.9/drivers/crypto/stm32/ |
D | stm32-cryp.c | 361 return is_encrypt(cryp) ? cryp->areq->cryptlen : in stm32_cryp_get_input_text_len() 362 cryp->areq->cryptlen - cryp->authsize; in stm32_cryp_get_input_text_len() 809 if (req->cryptlen % AES_BLOCK_SIZE) in stm32_cryp_aes_ecb_encrypt() 812 if (req->cryptlen == 0) in stm32_cryp_aes_ecb_encrypt() 820 if (req->cryptlen % AES_BLOCK_SIZE) in stm32_cryp_aes_ecb_decrypt() 823 if (req->cryptlen == 0) in stm32_cryp_aes_ecb_decrypt() 831 if (req->cryptlen % AES_BLOCK_SIZE) in stm32_cryp_aes_cbc_encrypt() 834 if (req->cryptlen == 0) in stm32_cryp_aes_cbc_encrypt() 842 if (req->cryptlen % AES_BLOCK_SIZE) in stm32_cryp_aes_cbc_decrypt() 845 if (req->cryptlen == 0) in stm32_cryp_aes_cbc_decrypt() [all …]
|
/linux-6.1.9/drivers/crypto/cavium/nitrox/ |
D | nitrox_aead.c | 165 creq->gph.param0 = cpu_to_be16(rctx->cryptlen); in nitrox_set_creq() 166 creq->gph.param1 = cpu_to_be16(rctx->cryptlen + rctx->assoclen); in nitrox_set_creq() 227 rctx->cryptlen = areq->cryptlen; in nitrox_aes_gcm_enc() 229 rctx->srclen = areq->assoclen + areq->cryptlen; in nitrox_aes_gcm_enc() 261 rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_aes_gcm_dec() 263 rctx->srclen = areq->cryptlen + areq->assoclen; in nitrox_aes_gcm_dec() 449 aead_rctx->cryptlen = areq->cryptlen; in nitrox_rfc4106_enc() 451 aead_rctx->srclen = aead_rctx->assoclen + aead_rctx->cryptlen; in nitrox_rfc4106_enc() 481 aead_rctx->cryptlen = areq->cryptlen - aead->authsize; in nitrox_rfc4106_dec() 484 areq->cryptlen - GCM_RFC4106_IV_SIZE + areq->assoclen; in nitrox_rfc4106_dec()
|
/linux-6.1.9/drivers/crypto/keembay/ |
D | keembay-ocs-aes-core.c | 264 if (req->cryptlen % AES_BLOCK_SIZE != 0) in kmb_ocs_sk_validate_input() 271 if (req->cryptlen % AES_BLOCK_SIZE != 0) in kmb_ocs_sk_validate_input() 292 if (req->cryptlen < AES_BLOCK_SIZE) in kmb_ocs_sk_validate_input() 329 req->cryptlen, req->iv); in kmb_ocs_sk_common() 346 if (!req->cryptlen && mode != OCS_MODE_CTS) in kmb_ocs_sk_common() 418 req->cryptlen - iv_size, iv_size, 0); in kmb_ocs_sk_prepare_inplace() 423 req->cryptlen - AES_BLOCK_SIZE, in kmb_ocs_sk_prepare_inplace() 424 req->cryptlen - (2 * AES_BLOCK_SIZE)); in kmb_ocs_sk_prepare_inplace() 437 req->cryptlen, 0); in kmb_ocs_sk_prepare_inplace() 457 rctx->src_nents = sg_nents_for_len(req->src, req->cryptlen); in kmb_ocs_sk_prepare_notinplace() [all …]
|
/linux-6.1.9/drivers/crypto/gemini/ |
D | sl3516-ce-cipher.c | 30 if (areq->cryptlen == 0 || areq->cryptlen % 16) { in sl3516_ce_need_fallback() 115 areq->cryptlen, areq->iv); in sl3516_ce_cipher_fallback() 143 areq->cryptlen, in sl3516_ce_cipher() 175 len = areq->cryptlen; in sl3516_ce_cipher() 185 areq->cryptlen, i, rctx->t_src[i].len, sg->offset, todo); in sl3516_ce_cipher() 192 dev_err(ce->dev, "remaining len %d/%u nr_sgs=%d\n", len, areq->cryptlen, nr_sgs); in sl3516_ce_cipher() 197 len = areq->cryptlen; in sl3516_ce_cipher() 207 areq->cryptlen, i, rctx->t_dst[i].len, sg->offset, todo); in sl3516_ce_cipher() 230 ecb->cipher.algorithm_len = areq->cryptlen; in sl3516_ce_cipher()
|
/linux-6.1.9/arch/arm64/crypto/ |
D | aes-glue.c | 282 int cbc_blocks = DIV_ROUND_UP(req->cryptlen, AES_BLOCK_SIZE) - 2; in cts_cbc_encrypt() 292 if (req->cryptlen <= AES_BLOCK_SIZE) { in cts_cbc_encrypt() 293 if (req->cryptlen < AES_BLOCK_SIZE) in cts_cbc_encrypt() 308 if (req->cryptlen == AES_BLOCK_SIZE) in cts_cbc_encrypt() 311 dst = src = scatterwalk_ffwd(sg_src, req->src, subreq.cryptlen); in cts_cbc_encrypt() 314 subreq.cryptlen); in cts_cbc_encrypt() 319 req->cryptlen - cbc_blocks * AES_BLOCK_SIZE, in cts_cbc_encrypt() 339 int cbc_blocks = DIV_ROUND_UP(req->cryptlen, AES_BLOCK_SIZE) - 2; in cts_cbc_decrypt() 349 if (req->cryptlen <= AES_BLOCK_SIZE) { in cts_cbc_decrypt() 350 if (req->cryptlen < AES_BLOCK_SIZE) in cts_cbc_decrypt() [all …]
|
/linux-6.1.9/include/linux/ |
D | crypto.h | 523 void crypto_stats_aead_encrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret); 524 void crypto_stats_aead_decrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret); 538 void crypto_stats_skcipher_encrypt(unsigned int cryptlen, int ret, struct crypto_alg *alg); 539 void crypto_stats_skcipher_decrypt(unsigned int cryptlen, int ret, struct crypto_alg *alg); 545 static inline void crypto_stats_aead_encrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret) in crypto_stats_aead_encrypt() argument 547 static inline void crypto_stats_aead_decrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret) in crypto_stats_aead_decrypt() argument 575 static inline void crypto_stats_skcipher_encrypt(unsigned int cryptlen, int ret, struct crypto_alg … in crypto_stats_skcipher_encrypt() argument 577 static inline void crypto_stats_skcipher_decrypt(unsigned int cryptlen, int ret, struct crypto_alg … in crypto_stats_skcipher_decrypt() argument
|