/openbmc/linux/crypto/ |
H A D | echainiv.c | 34 unsigned int ivsize = crypto_aead_ivsize(geniv); in echainiv_encrypt() local 37 if (req->cryptlen < ivsize) in echainiv_encrypt() 65 memcpy(&nseqno, info + ivsize - 8, 8); in echainiv_encrypt() 67 memset(info, 0, ivsize); in echainiv_encrypt() 69 scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); in echainiv_encrypt() 74 memcpy(&a, ctx->salt + ivsize - 8, 8); in echainiv_encrypt() 79 memcpy(info + ivsize - 8, &a, 8); in echainiv_encrypt() 80 } while ((ivsize -= 8)); in echainiv_encrypt() 92 unsigned int ivsize = crypto_aead_ivsize(geniv); in echainiv_decrypt() local 94 if (req->cryptlen < ivsize) in echainiv_decrypt() [all …]
|
H A D | seqiv.c | 55 unsigned int ivsize = 8; in seqiv_aead_encrypt() local 58 if (req->cryptlen < ivsize) in seqiv_aead_encrypt() 84 info = kmemdup(req->iv, ivsize, req->base.flags & in seqiv_aead_encrypt() 96 req->cryptlen - ivsize, info); in seqiv_aead_encrypt() 97 aead_request_set_ad(subreq, req->assoclen + ivsize); in seqiv_aead_encrypt() 99 crypto_xor(info, ctx->salt, ivsize); in seqiv_aead_encrypt() 100 scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1); in seqiv_aead_encrypt() 115 unsigned int ivsize = 8; in seqiv_aead_decrypt() local 117 if (req->cryptlen < ivsize + crypto_aead_authsize(geniv)) in seqiv_aead_decrypt() 127 req->cryptlen - ivsize, req->iv); in seqiv_aead_decrypt() [all …]
|
H A D | essiv.c | 206 int ivsize = crypto_aead_ivsize(tfm); in essiv_aead_crypt() local 207 int ssize = req->assoclen - ivsize; in essiv_aead_crypt() 218 memcpy(iv, req->iv, ivsize); in essiv_aead_crypt() 238 sg_set_buf(rctx->sg + 1, iv, ivsize); in essiv_aead_crypt() 415 int ivsize) in essiv_supported_algorithms() argument 430 if (ivsize != alg->cra_blocksize) in essiv_supported_algorithms() 457 int ivsize; in essiv_create() local 494 ivsize = crypto_skcipher_alg_ivsize(skcipher_alg); in essiv_create() 518 ivsize = aead_alg->ivsize; in essiv_create() 543 ivsize)) { in essiv_create() [all …]
|
H A D | geniv.c | 47 unsigned int ivsize; in aead_geniv_alloc() local 69 ivsize = crypto_aead_alg_ivsize(alg); in aead_geniv_alloc() 73 if (ivsize < sizeof(u64)) in aead_geniv_alloc() 94 inst->alg.ivsize = ivsize; in aead_geniv_alloc()
|
/openbmc/linux/drivers/crypto/caam/ |
H A D | caamalg_desc.h | 58 struct alginfo *adata, unsigned int ivsize, 64 struct alginfo *adata, unsigned int ivsize, 70 struct alginfo *adata, unsigned int ivsize, 76 unsigned int ivsize, unsigned int icvsize, 80 unsigned int ivsize, unsigned int icvsize, 84 unsigned int ivsize, unsigned int icvsize, 88 unsigned int ivsize, unsigned int icvsize, 92 unsigned int ivsize, unsigned int icvsize, 96 unsigned int ivsize, unsigned int icvsize, 100 struct alginfo *adata, unsigned int ivsize, [all …]
|
H A D | caamalg_qi.c | 90 unsigned int ivsize = crypto_aead_ivsize(aead); in aead_set_sh_desc() local 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() 308 unsigned int ivsize = crypto_aead_ivsize(aead); in gcm_set_sh_desc() local 327 cnstr_shdsc_gcm_encap(ctx->sh_desc_enc, &ctx->cdata, ivsize, in gcm_set_sh_desc() 342 cnstr_shdsc_gcm_decap(ctx->sh_desc_dec, &ctx->cdata, ivsize, in gcm_set_sh_desc() 411 unsigned int ivsize = crypto_aead_ivsize(aead); in rfc4106_set_sh_desc() local 431 cnstr_shdsc_rfc4106_encap(ctx->sh_desc_enc, &ctx->cdata, ivsize, in rfc4106_set_sh_desc() 445 cnstr_shdsc_rfc4106_decap(ctx->sh_desc_dec, &ctx->cdata, ivsize, in rfc4106_set_sh_desc() [all …]
|
H A D | caamalg.c | 195 unsigned int ivsize = crypto_aead_ivsize(aead); in aead_set_sh_desc() local 265 cnstr_shdsc_aead_encap(desc, &ctx->cdata, &ctx->adata, ivsize, in aead_set_sh_desc() 287 cnstr_shdsc_aead_decap(desc, &ctx->cdata, &ctx->adata, ivsize, in aead_set_sh_desc() 311 cnstr_shdsc_aead_givencap(desc, &ctx->cdata, &ctx->adata, ivsize, in aead_set_sh_desc() 336 unsigned int ivsize = crypto_aead_ivsize(aead); in gcm_set_sh_desc() local 358 cnstr_shdsc_gcm_encap(desc, &ctx->cdata, ivsize, ctx->authsize, false); in gcm_set_sh_desc() 375 cnstr_shdsc_gcm_decap(desc, &ctx->cdata, ivsize, ctx->authsize, false); in gcm_set_sh_desc() 401 unsigned int ivsize = crypto_aead_ivsize(aead); in rfc4106_set_sh_desc() local 423 cnstr_shdsc_rfc4106_encap(desc, &ctx->cdata, ivsize, ctx->authsize, in rfc4106_set_sh_desc() 441 cnstr_shdsc_rfc4106_decap(desc, &ctx->cdata, ivsize, ctx->authsize, in rfc4106_set_sh_desc() [all …]
|
H A D | caamalg_desc.c | 289 struct alginfo *adata, unsigned int ivsize, in cnstr_shdsc_aead_encap() argument 315 append_seq_load(desc, ivsize, LDST_CLASS_1_CCB | in cnstr_shdsc_aead_encap() 384 struct alginfo *adata, unsigned int ivsize, in cnstr_shdsc_aead_decap() argument 411 append_seq_load(desc, ivsize, LDST_CLASS_1_CCB | in cnstr_shdsc_aead_decap() 421 ivsize); in cnstr_shdsc_aead_decap() 429 ivsize); in cnstr_shdsc_aead_decap() 443 append_seq_load(desc, ivsize, LDST_CLASS_1_CCB | in cnstr_shdsc_aead_decap() 447 (ctx1_iv_off << MOVE_OFFSET_SHIFT) | ivsize); in cnstr_shdsc_aead_decap() 501 struct alginfo *adata, unsigned int ivsize, in cnstr_shdsc_aead_givencap() argument 529 append_seq_load(desc, ivsize, LDST_CLASS_1_CCB | in cnstr_shdsc_aead_givencap() [all …]
|
H A D | caamalg_qi2.c | 152 int dst_nents, dma_addr_t iv_dma, int ivsize, in caam_unmap() argument 166 dma_unmap_single(dev, iv_dma, ivsize, iv_dir); in caam_unmap() 177 unsigned int ivsize = crypto_aead_ivsize(aead); in aead_set_sh_desc() local 242 ivsize, ctx->authsize, is_rfc3686, in aead_set_sh_desc() 247 ivsize, ctx->authsize, is_rfc3686, nonce, in aead_set_sh_desc() 268 ivsize, ctx->authsize, alg->caam.geniv, in aead_set_sh_desc() 368 int ivsize = 0; in aead_edesc_alloc() local 448 ivsize = crypto_aead_ivsize(aead); in aead_edesc_alloc() 462 qm_sg_nents = 1 + !!ivsize + mapped_src_nents; in aead_edesc_alloc() 467 1 + !!ivsize + in aead_edesc_alloc() [all …]
|
/openbmc/linux/drivers/crypto/cavium/nitrox/ |
H A D | nitrox_skcipher.c | 84 int ivsize = crypto_skcipher_ivsize(cipher); in nitrox_cbc_cipher_callback() local 85 unsigned int start = skreq->cryptlen - ivsize; in nitrox_cbc_cipher_callback() 93 scatterwalk_map_and_copy(skreq->iv, skreq->dst, start, ivsize, in nitrox_cbc_cipher_callback() 98 ivsize, 0); in nitrox_cbc_cipher_callback() 100 memcpy(skreq->iv, nkreq->iv_out, ivsize); in nitrox_cbc_cipher_callback() 208 static int alloc_src_sglist(struct skcipher_request *skreq, int ivsize) in alloc_src_sglist() argument 215 ret = alloc_src_req_buf(nkreq, nents, ivsize); in alloc_src_sglist() 219 nitrox_creq_copy_iv(nkreq->src, skreq->iv, ivsize); in alloc_src_sglist() 220 nitrox_creq_set_src_sg(nkreq, nents, ivsize, skreq->src, in alloc_src_sglist() 226 static int alloc_dst_sglist(struct skcipher_request *skreq, int ivsize) in alloc_dst_sglist() argument [all …]
|
H A D | nitrox_aead.c | 94 struct scatterlist *src, char *iv, int ivsize, in alloc_src_sglist() argument 106 ret = alloc_src_req_buf(nkreq, nents, ivsize); in alloc_src_sglist() 110 nitrox_creq_copy_iv(nkreq->src, iv, ivsize); in alloc_src_sglist() 111 nitrox_creq_set_src_sg(nkreq, nents, ivsize, src, buflen); in alloc_src_sglist() 117 struct scatterlist *dst, int ivsize, int buflen) in alloc_dst_sglist() argument 136 nitrox_creq_set_dst_sg(nkreq, nents, ivsize, dst, buflen); in alloc_dst_sglist() 167 creq->gph.param2 = cpu_to_be16(rctx->ivsize + rctx->assoclen); in nitrox_set_creq() 169 param3.auth_offset = rctx->ivsize; in nitrox_set_creq() 175 ret = alloc_src_sglist(&rctx->nkreq, rctx->src, rctx->iv, rctx->ivsize, in nitrox_set_creq() 180 ret = alloc_dst_sglist(&rctx->nkreq, rctx->dst, rctx->ivsize, in nitrox_set_creq() [all …]
|
H A D | nitrox_req.h | 241 int ivsize; member 621 int nents, int ivsize) in alloc_src_req_buf() argument 625 nkreq->src = alloc_req_buf(nents, ivsize, creq->gfp); in alloc_src_req_buf() 637 static inline struct scatterlist *nitrox_creq_src_sg(char *iv, int ivsize) in nitrox_creq_src_sg() argument 639 return (struct scatterlist *)(iv + ivsize); in nitrox_creq_src_sg() 643 int nents, int ivsize, in nitrox_creq_set_src_sg() argument 650 creq->src = nitrox_creq_src_sg(iv, ivsize); in nitrox_creq_set_src_sg() 661 sg = create_single_sg(sg, iv, ivsize); in nitrox_creq_set_src_sg() 701 int nents, int ivsize, in nitrox_creq_set_dst_sg() argument 721 sg = create_single_sg(sg, iv, ivsize); in nitrox_creq_set_dst_sg()
|
/openbmc/linux/drivers/crypto/allwinner/sun8i-ss/ |
H A D | sun8i-ss-cipher.c | 129 unsigned int ivsize = crypto_skcipher_ivsize(tfm); in sun8i_ss_setup_ivs() local 135 rctx->ivlen = ivsize; in sun8i_ss_setup_ivs() 137 offset = areq->cryptlen - ivsize; in sun8i_ss_setup_ivs() 139 ivsize, 0); in sun8i_ss_setup_ivs() 149 memcpy(sf->iv[0], areq->iv, ivsize); in sun8i_ss_setup_ivs() 150 a = dma_map_single(ss->dev, sf->iv[i], ivsize, DMA_TO_DEVICE); in sun8i_ss_setup_ivs() 152 memzero_explicit(sf->iv[i], ivsize); in sun8i_ss_setup_ivs() 165 offset = sg->length - ivsize; in sun8i_ss_setup_ivs() 166 scatterwalk_map_and_copy(sf->iv[i], sg, offset, ivsize, 0); in sun8i_ss_setup_ivs() 176 dma_unmap_single(ss->dev, rctx->p_iv[i], ivsize, DMA_TO_DEVICE); in sun8i_ss_setup_ivs() [all …]
|
/openbmc/linux/drivers/crypto/allwinner/sun8i-ce/ |
H A D | sun8i-ce-cipher.c | 132 unsigned int todo, len, offset, ivsize; in sun8i_ce_cipher_prepare() local 195 ivsize = crypto_skcipher_ivsize(tfm); in sun8i_ce_cipher_prepare() 197 rctx->ivlen = ivsize; in sun8i_ce_cipher_prepare() 199 offset = areq->cryptlen - ivsize; in sun8i_ce_cipher_prepare() 201 offset, ivsize, 0); in sun8i_ce_cipher_prepare() 203 memcpy(chan->bounce_iv, areq->iv, ivsize); in sun8i_ce_cipher_prepare() 282 if (areq->iv && ivsize > 0) { in sun8i_ce_cipher_prepare() 285 offset = areq->cryptlen - ivsize; in sun8i_ce_cipher_prepare() 287 memcpy(areq->iv, chan->backup_iv, ivsize); in sun8i_ce_cipher_prepare() 288 memzero_explicit(chan->backup_iv, ivsize); in sun8i_ce_cipher_prepare() [all …]
|
/openbmc/linux/drivers/crypto/rockchip/ |
H A D | rk3288_crypto_skcipher.c | 306 int ivsize = crypto_skcipher_ivsize(tfm); in rk_cipher_run() local 324 ivsize = crypto_skcipher_ivsize(tfm); in rk_cipher_run() 327 offset = areq->cryptlen - ivsize; in rk_cipher_run() 329 offset, ivsize, 0); in rk_cipher_run() 344 offset = sgs->length - ivsize; in rk_cipher_run() 345 scatterwalk_map_and_copy(biv, sgs, offset, ivsize, 0); in rk_cipher_run() 367 if (ivsize) { in rk_cipher_run() 368 if (ivsize == DES_BLOCK_SIZE) in rk_cipher_run() 369 memcpy_toio(rkc->reg + RK_CRYPTO_TDES_IV_0, ivtouse, ivsize); in rk_cipher_run() 371 memcpy_toio(rkc->reg + RK_CRYPTO_AES_IV_0, ivtouse, ivsize); in rk_cipher_run() [all …]
|
/openbmc/linux/drivers/crypto/ccree/ |
H A D | cc_cipher.c | 512 unsigned int ivsize, struct cc_hw_desc desc[], in cc_setup_readiv_desc() argument 534 set_dout_dlli(&desc[*seq_size], iv_dma_addr, ivsize, NS_BIT, 1); in cc_setup_readiv_desc() 568 unsigned int ivsize, unsigned int nbytes, in cc_setup_state_desc() argument 588 set_din_type(&desc[*seq_size], DMA_DLLI, iv_dma_addr, ivsize, in cc_setup_state_desc() 612 unsigned int ivsize, unsigned int nbytes, in cc_setup_xex_state_desc() argument 865 unsigned int ivsize = crypto_skcipher_ivsize(sk_tfm); in cc_cipher_complete() local 869 cc_unmap_cipher_request(dev, req_ctx, ivsize, src, dst); in cc_cipher_complete() 870 memcpy(req->iv, req_ctx->iv, ivsize); in cc_cipher_complete() 883 unsigned int ivsize = crypto_skcipher_ivsize(sk_tfm); in cc_cipher_process() local 927 req_ctx->iv = kmemdup(iv, ivsize, flags); in cc_cipher_process() [all …]
|
/openbmc/linux/drivers/crypto/amlogic/ |
H A D | amlogic-gxl-cipher.c | 99 unsigned int keyivlen, ivsize, offset, tloffset; in meson_cipher() local 129 ivsize = crypto_skcipher_ivsize(tfm); in meson_cipher() 130 if (areq->iv && ivsize > 0) { in meson_cipher() 131 if (ivsize > areq->cryptlen) { in meson_cipher() 132 dev_err(mc->dev, "invalid ivsize=%d vs len=%d\n", ivsize, areq->cryptlen); in meson_cipher() 136 memcpy(bkeyiv + 32, areq->iv, ivsize); in meson_cipher() 139 backup_iv = kzalloc(ivsize, GFP_KERNEL); in meson_cipher() 144 offset = areq->cryptlen - ivsize; in meson_cipher() 146 ivsize, 0); in meson_cipher() 245 if (areq->iv && ivsize > 0) { in meson_cipher() [all …]
|
/openbmc/linux/drivers/crypto/allwinner/sun4i-ss/ |
H A D | sun4i-ss-cipher.c | 20 unsigned int ivsize = crypto_skcipher_ivsize(tfm); in sun4i_ss_opti_poll() local 49 if (areq->iv && ivsize > 0 && mode & SS_DECRYPTION) { in sun4i_ss_opti_poll() 51 areq->cryptlen - ivsize, ivsize, 0); in sun4i_ss_opti_poll() 66 for (i = 0; i < 4 && i < ivsize / 4; i++) { in sun4i_ss_opti_poll() 134 memcpy(areq->iv, ctx->backup_iv, ivsize); in sun4i_ss_opti_poll() 135 memzero_explicit(ctx->backup_iv, ivsize); in sun4i_ss_opti_poll() 137 scatterwalk_map_and_copy(areq->iv, areq->dst, areq->cryptlen - ivsize, in sun4i_ss_opti_poll() 138 ivsize, 0); in sun4i_ss_opti_poll() 184 unsigned int ivsize = crypto_skcipher_ivsize(tfm); in sun4i_ss_cipher_poll() local 242 if (areq->iv && ivsize > 0 && mode & SS_DECRYPTION) { in sun4i_ss_cipher_poll() [all …]
|
/openbmc/linux/drivers/crypto/qce/ |
H A D | skcipher.c | 59 memcpy(rctx->iv, result_buf->encr_cntr_iv, rctx->ivsize); in qce_skcipher_done() 78 rctx->ivsize = crypto_skcipher_ivsize(skcipher); in qce_skcipher_async_req_handle() 355 unsigned int ivsize; member 366 .ivsize = 0, 375 .ivsize = AES_BLOCK_SIZE, 385 .ivsize = AES_BLOCK_SIZE, 394 .ivsize = AES_BLOCK_SIZE, 403 .ivsize = 0, 412 .ivsize = DES_BLOCK_SIZE, 421 .ivsize = 0, [all …]
|
H A D | aead.c | 363 unsigned int msglen_size, ivsize; in qce_aead_create_ccm_nonce() local 376 ivsize = rctx->ivsize; in qce_aead_create_ccm_nonce() 384 rctx->iv[ivsize - i - 1] = 0; in qce_aead_create_ccm_nonce() 396 memcpy(&rctx->ccm_nonce[0], rctx->iv, rctx->ivsize); in qce_aead_create_ccm_nonce() 426 rctx->ivsize = AES_BLOCK_SIZE; in qce_aead_async_req_handle() 429 rctx->ivsize = crypto_aead_ivsize(tfm); in qce_aead_async_req_handle() 696 unsigned int ivsize; member 706 .ivsize = DES_BLOCK_SIZE, 714 .ivsize = DES3_EDE_BLOCK_SIZE, 722 .ivsize = DES_BLOCK_SIZE, [all …]
|
/openbmc/linux/drivers/crypto/ccp/ |
H A D | ccp-crypto-aes.c | 246 unsigned int ivsize; member 257 .ivsize = 0, 266 .ivsize = AES_BLOCK_SIZE, 275 .ivsize = AES_BLOCK_SIZE, 284 .ivsize = AES_BLOCK_SIZE, 293 .ivsize = AES_BLOCK_SIZE, 302 .ivsize = CTR_RFC3686_IV_SIZE, 329 alg->ivsize = def->ivsize; in ccp_register_aes_alg()
|
/openbmc/linux/block/ |
H A D | blk-crypto.c | 26 .ivsize = 16, 32 .ivsize = 16, 38 .ivsize = 32, 44 .ivsize = 16, 82 BUG_ON(blk_crypto_modes[i].ivsize > BLK_CRYPTO_MAX_IV_SIZE); in bio_crypt_ctx_init() 344 if (dun_bytes == 0 || dun_bytes > mode->ivsize) in blk_crypto_init_key()
|
/openbmc/linux/fs/crypto/ |
H A D | keysetup.c | 22 .ivsize = 16, 30 .ivsize = 16, 37 .ivsize = 16, 45 .ivsize = 16, 52 .ivsize = 16, 60 .ivsize = 16, 67 .ivsize = 32, 75 .ivsize = 32, 128 if (WARN_ON_ONCE(crypto_skcipher_ivsize(tfm) != mode->ivsize)) { in fscrypt_allocate_skcipher() 580 WARN_ON_ONCE(mode->ivsize > FSCRYPT_MAX_IV_SIZE); in fscrypt_setup_encryption_info()
|
/openbmc/linux/drivers/crypto/intel/ixp4xx/ |
H A D | ixp4xx_crypto.c | 394 unsigned int ivsize = crypto_skcipher_ivsize(tfm); in one_packet() local 397 if (ivsize > 0) { in one_packet() 398 offset = req->cryptlen - ivsize; in one_packet() 401 offset, ivsize, 0); in one_packet() 403 memcpy(req->iv, req_ctx->iv, ivsize); in one_packet() 404 memzero_explicit(req_ctx->iv, ivsize); in one_packet() 977 unsigned int ivsize = crypto_skcipher_ivsize(tfm); in ablk_perform() local 1012 BUG_ON(ivsize && !req->iv); in ablk_perform() 1013 memcpy(crypt->iv, req->iv, ivsize); in ablk_perform() 1014 if (ivsize > 0 && !encrypt) { in ablk_perform() [all …]
|
/openbmc/linux/drivers/crypto/marvell/octeontx/ |
H A D | otx_cptvf_algs.c | 152 u32 start, ivsize; in output_iv_copyback() local 161 ivsize = crypto_skcipher_ivsize(stfm); in output_iv_copyback() 162 start = sreq->cryptlen - ivsize; in output_iv_copyback() 166 ivsize, 0); in output_iv_copyback() 170 start, ivsize, 0); in output_iv_copyback() 172 memcpy(sreq->iv, req_info->iv_out, ivsize); in output_iv_copyback() 242 int ivsize = crypto_skcipher_ivsize(stfm); in create_ctx_hdr() local 243 u32 start = req->cryptlen - ivsize; in create_ctx_hdr() 260 req_info->iv_out = kmalloc(ivsize, flags); in create_ctx_hdr() 265 start, ivsize, 0); in create_ctx_hdr() [all …]
|