Lines Matching refs:walk
53 static void crypto_cfb_final(struct skcipher_walk *walk, in crypto_cfb_final() argument
59 u8 *src = walk->src.virt.addr; in crypto_cfb_final()
60 u8 *dst = walk->dst.virt.addr; in crypto_cfb_final()
61 u8 *iv = walk->iv; in crypto_cfb_final()
62 unsigned int nbytes = walk->nbytes; in crypto_cfb_final()
68 static int crypto_cfb_encrypt_segment(struct skcipher_walk *walk, in crypto_cfb_encrypt_segment() argument
72 unsigned int nbytes = walk->nbytes; in crypto_cfb_encrypt_segment()
73 u8 *src = walk->src.virt.addr; in crypto_cfb_encrypt_segment()
74 u8 *dst = walk->dst.virt.addr; in crypto_cfb_encrypt_segment()
75 u8 *iv = walk->iv; in crypto_cfb_encrypt_segment()
86 memcpy(walk->iv, iv, bsize); in crypto_cfb_encrypt_segment()
91 static int crypto_cfb_encrypt_inplace(struct skcipher_walk *walk, in crypto_cfb_encrypt_inplace() argument
95 unsigned int nbytes = walk->nbytes; in crypto_cfb_encrypt_inplace()
96 u8 *src = walk->src.virt.addr; in crypto_cfb_encrypt_inplace()
97 u8 *iv = walk->iv; in crypto_cfb_encrypt_inplace()
108 memcpy(walk->iv, iv, bsize); in crypto_cfb_encrypt_inplace()
116 struct skcipher_walk walk; in crypto_cfb_encrypt() local
120 err = skcipher_walk_virt(&walk, req, false); in crypto_cfb_encrypt()
122 while (walk.nbytes >= bsize) { in crypto_cfb_encrypt()
123 if (walk.src.virt.addr == walk.dst.virt.addr) in crypto_cfb_encrypt()
124 err = crypto_cfb_encrypt_inplace(&walk, tfm); in crypto_cfb_encrypt()
126 err = crypto_cfb_encrypt_segment(&walk, tfm); in crypto_cfb_encrypt()
127 err = skcipher_walk_done(&walk, err); in crypto_cfb_encrypt()
130 if (walk.nbytes) { in crypto_cfb_encrypt()
131 crypto_cfb_final(&walk, tfm); in crypto_cfb_encrypt()
132 err = skcipher_walk_done(&walk, 0); in crypto_cfb_encrypt()
138 static int crypto_cfb_decrypt_segment(struct skcipher_walk *walk, in crypto_cfb_decrypt_segment() argument
142 unsigned int nbytes = walk->nbytes; in crypto_cfb_decrypt_segment()
143 u8 *src = walk->src.virt.addr; in crypto_cfb_decrypt_segment()
144 u8 *dst = walk->dst.virt.addr; in crypto_cfb_decrypt_segment()
145 u8 *iv = walk->iv; in crypto_cfb_decrypt_segment()
156 memcpy(walk->iv, iv, bsize); in crypto_cfb_decrypt_segment()
161 static int crypto_cfb_decrypt_inplace(struct skcipher_walk *walk, in crypto_cfb_decrypt_inplace() argument
165 unsigned int nbytes = walk->nbytes; in crypto_cfb_decrypt_inplace()
166 u8 *src = walk->src.virt.addr; in crypto_cfb_decrypt_inplace()
167 u8 * const iv = walk->iv; in crypto_cfb_decrypt_inplace()
180 static int crypto_cfb_decrypt_blocks(struct skcipher_walk *walk, in crypto_cfb_decrypt_blocks() argument
183 if (walk->src.virt.addr == walk->dst.virt.addr) in crypto_cfb_decrypt_blocks()
184 return crypto_cfb_decrypt_inplace(walk, tfm); in crypto_cfb_decrypt_blocks()
186 return crypto_cfb_decrypt_segment(walk, tfm); in crypto_cfb_decrypt_blocks()
208 struct skcipher_walk walk; in crypto_cfb_decrypt() local
212 err = skcipher_walk_virt(&walk, req, false); in crypto_cfb_decrypt()
214 while (walk.nbytes >= bsize) { in crypto_cfb_decrypt()
215 err = crypto_cfb_decrypt_blocks(&walk, tfm); in crypto_cfb_decrypt()
216 err = skcipher_walk_done(&walk, err); in crypto_cfb_decrypt()
219 if (walk.nbytes) { in crypto_cfb_decrypt()
220 crypto_cfb_final(&walk, tfm); in crypto_cfb_decrypt()
221 err = skcipher_walk_done(&walk, 0); in crypto_cfb_decrypt()