Lines Matching refs:walk

43 	struct skcipher_walk walk;  in ecb_do_crypt()  local
47 err = skcipher_walk_virt(&walk, req, false); in ecb_do_crypt()
49 while ((nbytes = walk.nbytes) > 0) { in ecb_do_crypt()
50 const u8 *src = walk.src.virt.addr; in ecb_do_crypt()
51 u8 *dst = walk.dst.virt.addr; in ecb_do_crypt()
69 err = skcipher_walk_done(&walk, nbytes); in ecb_do_crypt()
97 struct skcipher_walk walk; in sm4_cbc_encrypt() local
101 err = skcipher_walk_virt(&walk, req, false); in sm4_cbc_encrypt()
103 while ((nbytes = walk.nbytes) > 0) { in sm4_cbc_encrypt()
104 const u8 *iv = walk.iv; in sm4_cbc_encrypt()
105 const u8 *src = walk.src.virt.addr; in sm4_cbc_encrypt()
106 u8 *dst = walk.dst.virt.addr; in sm4_cbc_encrypt()
116 if (iv != walk.iv) in sm4_cbc_encrypt()
117 memcpy(walk.iv, iv, SM4_BLOCK_SIZE); in sm4_cbc_encrypt()
119 err = skcipher_walk_done(&walk, nbytes); in sm4_cbc_encrypt()
131 struct skcipher_walk walk; in sm4_avx_cbc_decrypt() local
135 err = skcipher_walk_virt(&walk, req, false); in sm4_avx_cbc_decrypt()
137 while ((nbytes = walk.nbytes) > 0) { in sm4_avx_cbc_decrypt()
138 const u8 *src = walk.src.virt.addr; in sm4_avx_cbc_decrypt()
139 u8 *dst = walk.dst.virt.addr; in sm4_avx_cbc_decrypt()
144 func(ctx->rkey_dec, dst, src, walk.iv); in sm4_avx_cbc_decrypt()
170 crypto_xor_cpy(dst, walk.iv, keystream, SM4_BLOCK_SIZE); in sm4_avx_cbc_decrypt()
171 memcpy(walk.iv, iv, SM4_BLOCK_SIZE); in sm4_avx_cbc_decrypt()
178 err = skcipher_walk_done(&walk, nbytes); in sm4_avx_cbc_decrypt()
195 struct skcipher_walk walk; in sm4_cfb_encrypt() local
199 err = skcipher_walk_virt(&walk, req, false); in sm4_cfb_encrypt()
201 while ((nbytes = walk.nbytes) > 0) { in sm4_cfb_encrypt()
203 const u8 *iv = walk.iv; in sm4_cfb_encrypt()
204 const u8 *src = walk.src.virt.addr; in sm4_cfb_encrypt()
205 u8 *dst = walk.dst.virt.addr; in sm4_cfb_encrypt()
215 if (iv != walk.iv) in sm4_cfb_encrypt()
216 memcpy(walk.iv, iv, SM4_BLOCK_SIZE); in sm4_cfb_encrypt()
219 if (walk.nbytes == walk.total && nbytes > 0) { in sm4_cfb_encrypt()
220 sm4_crypt_block(ctx->rkey_enc, keystream, walk.iv); in sm4_cfb_encrypt()
225 err = skcipher_walk_done(&walk, nbytes); in sm4_cfb_encrypt()
237 struct skcipher_walk walk; in sm4_avx_cfb_decrypt() local
241 err = skcipher_walk_virt(&walk, req, false); in sm4_avx_cfb_decrypt()
243 while ((nbytes = walk.nbytes) > 0) { in sm4_avx_cfb_decrypt()
244 const u8 *src = walk.src.virt.addr; in sm4_avx_cfb_decrypt()
245 u8 *dst = walk.dst.virt.addr; in sm4_avx_cfb_decrypt()
250 func(ctx->rkey_enc, dst, src, walk.iv); in sm4_avx_cfb_decrypt()
260 memcpy(keystream, walk.iv, SM4_BLOCK_SIZE); in sm4_avx_cfb_decrypt()
264 memcpy(walk.iv, src + (nblocks - 1) * SM4_BLOCK_SIZE, in sm4_avx_cfb_decrypt()
280 if (walk.nbytes == walk.total && nbytes > 0) { in sm4_avx_cfb_decrypt()
283 sm4_crypt_block(ctx->rkey_enc, keystream, walk.iv); in sm4_avx_cfb_decrypt()
288 err = skcipher_walk_done(&walk, nbytes); in sm4_avx_cfb_decrypt()
306 struct skcipher_walk walk; in sm4_avx_ctr_crypt() local
310 err = skcipher_walk_virt(&walk, req, false); in sm4_avx_ctr_crypt()
312 while ((nbytes = walk.nbytes) > 0) { in sm4_avx_ctr_crypt()
313 const u8 *src = walk.src.virt.addr; in sm4_avx_ctr_crypt()
314 u8 *dst = walk.dst.virt.addr; in sm4_avx_ctr_crypt()
319 func(ctx->rkey_enc, dst, src, walk.iv); in sm4_avx_ctr_crypt()
332 walk.iv, SM4_BLOCK_SIZE); in sm4_avx_ctr_crypt()
333 crypto_inc(walk.iv, SM4_BLOCK_SIZE); in sm4_avx_ctr_crypt()
348 if (walk.nbytes == walk.total && nbytes > 0) { in sm4_avx_ctr_crypt()
351 memcpy(keystream, walk.iv, SM4_BLOCK_SIZE); in sm4_avx_ctr_crypt()
352 crypto_inc(walk.iv, SM4_BLOCK_SIZE); in sm4_avx_ctr_crypt()
362 err = skcipher_walk_done(&walk, nbytes); in sm4_avx_ctr_crypt()