• Home
  • Raw
  • Download

Lines Matching refs:walk

80 static int ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk,  in ecb_crypt()  argument
89 err = blkcipher_walk_virt(desc, walk); in ecb_crypt()
91 while ((nbytes = walk->nbytes)) { in ecb_crypt()
92 u8 *wsrc = walk->src.virt.addr; in ecb_crypt()
93 u8 *wdst = walk->dst.virt.addr; in ecb_crypt()
119 err = blkcipher_walk_done(desc, walk, nbytes); in ecb_crypt()
128 struct blkcipher_walk walk; in ecb_encrypt() local
130 blkcipher_walk_init(&walk, dst, src, nbytes); in ecb_encrypt()
131 return ecb_crypt(desc, &walk, blowfish_enc_blk, blowfish_enc_blk_4way); in ecb_encrypt()
137 struct blkcipher_walk walk; in ecb_decrypt() local
139 blkcipher_walk_init(&walk, dst, src, nbytes); in ecb_decrypt()
140 return ecb_crypt(desc, &walk, blowfish_dec_blk, blowfish_dec_blk_4way); in ecb_decrypt()
144 struct blkcipher_walk *walk) in __cbc_encrypt() argument
148 unsigned int nbytes = walk->nbytes; in __cbc_encrypt()
149 u64 *src = (u64 *)walk->src.virt.addr; in __cbc_encrypt()
150 u64 *dst = (u64 *)walk->dst.virt.addr; in __cbc_encrypt()
151 u64 *iv = (u64 *)walk->iv; in __cbc_encrypt()
163 *(u64 *)walk->iv = *iv; in __cbc_encrypt()
170 struct blkcipher_walk walk; in cbc_encrypt() local
173 blkcipher_walk_init(&walk, dst, src, nbytes); in cbc_encrypt()
174 err = blkcipher_walk_virt(desc, &walk); in cbc_encrypt()
176 while ((nbytes = walk.nbytes)) { in cbc_encrypt()
177 nbytes = __cbc_encrypt(desc, &walk); in cbc_encrypt()
178 err = blkcipher_walk_done(desc, &walk, nbytes); in cbc_encrypt()
185 struct blkcipher_walk *walk) in __cbc_decrypt() argument
189 unsigned int nbytes = walk->nbytes; in __cbc_decrypt()
190 u64 *src = (u64 *)walk->src.virt.addr; in __cbc_decrypt()
191 u64 *dst = (u64 *)walk->dst.virt.addr; in __cbc_decrypt()
245 *dst ^= *(u64 *)walk->iv; in __cbc_decrypt()
246 *(u64 *)walk->iv = last_iv; in __cbc_decrypt()
254 struct blkcipher_walk walk; in cbc_decrypt() local
257 blkcipher_walk_init(&walk, dst, src, nbytes); in cbc_decrypt()
258 err = blkcipher_walk_virt(desc, &walk); in cbc_decrypt()
260 while ((nbytes = walk.nbytes)) { in cbc_decrypt()
261 nbytes = __cbc_decrypt(desc, &walk); in cbc_decrypt()
262 err = blkcipher_walk_done(desc, &walk, nbytes); in cbc_decrypt()
268 static void ctr_crypt_final(struct bf_ctx *ctx, struct blkcipher_walk *walk) in ctr_crypt_final() argument
270 u8 *ctrblk = walk->iv; in ctr_crypt_final()
272 u8 *src = walk->src.virt.addr; in ctr_crypt_final()
273 u8 *dst = walk->dst.virt.addr; in ctr_crypt_final()
274 unsigned int nbytes = walk->nbytes; in ctr_crypt_final()
284 struct blkcipher_walk *walk) in __ctr_crypt() argument
288 unsigned int nbytes = walk->nbytes; in __ctr_crypt()
289 u64 *src = (u64 *)walk->src.virt.addr; in __ctr_crypt()
290 u64 *dst = (u64 *)walk->dst.virt.addr; in __ctr_crypt()
291 u64 ctrblk = be64_to_cpu(*(__be64 *)walk->iv); in __ctr_crypt()
335 *(__be64 *)walk->iv = cpu_to_be64(ctrblk); in __ctr_crypt()
342 struct blkcipher_walk walk; in ctr_crypt() local
345 blkcipher_walk_init(&walk, dst, src, nbytes); in ctr_crypt()
346 err = blkcipher_walk_virt_block(desc, &walk, BF_BLOCK_SIZE); in ctr_crypt()
348 while ((nbytes = walk.nbytes) >= BF_BLOCK_SIZE) { in ctr_crypt()
349 nbytes = __ctr_crypt(desc, &walk); in ctr_crypt()
350 err = blkcipher_walk_done(desc, &walk, nbytes); in ctr_crypt()
353 if (walk.nbytes) { in ctr_crypt()
354 ctr_crypt_final(crypto_blkcipher_ctx(desc->tfm), &walk); in ctr_crypt()
355 err = blkcipher_walk_done(desc, &walk, 0); in ctr_crypt()