Lines Matching refs:walk

184 	struct skcipher_walk walk;  in ecb_encrypt()  local
187 err = skcipher_walk_virt(&walk, req, false); in ecb_encrypt()
189 while ((blocks = (walk.nbytes / AES_BLOCK_SIZE))) { in ecb_encrypt()
191 aes_ecb_encrypt(walk.dst.virt.addr, walk.src.virt.addr, in ecb_encrypt()
194 err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); in ecb_encrypt()
204 struct skcipher_walk walk; in ecb_decrypt() local
207 err = skcipher_walk_virt(&walk, req, false); in ecb_decrypt()
209 while ((blocks = (walk.nbytes / AES_BLOCK_SIZE))) { in ecb_decrypt()
211 aes_ecb_decrypt(walk.dst.virt.addr, walk.src.virt.addr, in ecb_decrypt()
214 err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); in ecb_decrypt()
220 struct skcipher_walk *walk) in cbc_encrypt_walk() argument
227 while ((blocks = (walk->nbytes / AES_BLOCK_SIZE))) { in cbc_encrypt_walk()
229 aes_cbc_encrypt(walk->dst.virt.addr, walk->src.virt.addr, in cbc_encrypt_walk()
230 ctx->key_enc, rounds, blocks, walk->iv); in cbc_encrypt_walk()
232 err = skcipher_walk_done(walk, walk->nbytes % AES_BLOCK_SIZE); in cbc_encrypt_walk()
239 struct skcipher_walk walk; in cbc_encrypt() local
242 err = skcipher_walk_virt(&walk, req, false); in cbc_encrypt()
245 return cbc_encrypt_walk(req, &walk); in cbc_encrypt()
249 struct skcipher_walk *walk) in cbc_decrypt_walk() argument
256 while ((blocks = (walk->nbytes / AES_BLOCK_SIZE))) { in cbc_decrypt_walk()
258 aes_cbc_decrypt(walk->dst.virt.addr, walk->src.virt.addr, in cbc_decrypt_walk()
259 ctx->key_dec, rounds, blocks, walk->iv); in cbc_decrypt_walk()
261 err = skcipher_walk_done(walk, walk->nbytes % AES_BLOCK_SIZE); in cbc_decrypt_walk()
268 struct skcipher_walk walk; in cbc_decrypt() local
271 err = skcipher_walk_virt(&walk, req, false); in cbc_decrypt()
274 return cbc_decrypt_walk(req, &walk); in cbc_decrypt()
286 struct skcipher_walk walk; in cts_cbc_encrypt() local
303 err = skcipher_walk_virt(&walk, &subreq, false) ?: in cts_cbc_encrypt()
304 cbc_encrypt_walk(&subreq, &walk); in cts_cbc_encrypt()
322 err = skcipher_walk_virt(&walk, &subreq, false); in cts_cbc_encrypt()
327 aes_cbc_cts_encrypt(walk.dst.virt.addr, walk.src.virt.addr, in cts_cbc_encrypt()
328 ctx->key_enc, rounds, walk.nbytes, walk.iv); in cts_cbc_encrypt()
331 return skcipher_walk_done(&walk, 0); in cts_cbc_encrypt()
343 struct skcipher_walk walk; in cts_cbc_decrypt() local
360 err = skcipher_walk_virt(&walk, &subreq, false) ?: in cts_cbc_decrypt()
361 cbc_decrypt_walk(&subreq, &walk); in cts_cbc_decrypt()
379 err = skcipher_walk_virt(&walk, &subreq, false); in cts_cbc_decrypt()
384 aes_cbc_cts_decrypt(walk.dst.virt.addr, walk.src.virt.addr, in cts_cbc_decrypt()
385 ctx->key_dec, rounds, walk.nbytes, walk.iv); in cts_cbc_decrypt()
388 return skcipher_walk_done(&walk, 0); in cts_cbc_decrypt()
412 struct skcipher_walk walk; in essiv_cbc_encrypt() local
415 err = skcipher_walk_virt(&walk, req, false); in essiv_cbc_encrypt()
417 blocks = walk.nbytes / AES_BLOCK_SIZE; in essiv_cbc_encrypt()
420 aes_essiv_cbc_encrypt(walk.dst.virt.addr, walk.src.virt.addr, in essiv_cbc_encrypt()
424 err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); in essiv_cbc_encrypt()
426 return err ?: cbc_encrypt_walk(req, &walk); in essiv_cbc_encrypt()
434 struct skcipher_walk walk; in essiv_cbc_decrypt() local
437 err = skcipher_walk_virt(&walk, req, false); in essiv_cbc_decrypt()
439 blocks = walk.nbytes / AES_BLOCK_SIZE; in essiv_cbc_decrypt()
442 aes_essiv_cbc_decrypt(walk.dst.virt.addr, walk.src.virt.addr, in essiv_cbc_decrypt()
446 err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); in essiv_cbc_decrypt()
448 return err ?: cbc_decrypt_walk(req, &walk); in essiv_cbc_decrypt()
456 struct skcipher_walk walk; in xctr_encrypt() local
459 err = skcipher_walk_virt(&walk, req, false); in xctr_encrypt()
461 while (walk.nbytes > 0) { in xctr_encrypt()
462 const u8 *src = walk.src.virt.addr; in xctr_encrypt()
463 unsigned int nbytes = walk.nbytes; in xctr_encrypt()
464 u8 *dst = walk.dst.virt.addr; in xctr_encrypt()
478 else if (nbytes < walk.total) in xctr_encrypt()
483 walk.iv, byte_ctr); in xctr_encrypt()
487 memcpy(walk.dst.virt.addr, in xctr_encrypt()
491 err = skcipher_walk_done(&walk, walk.nbytes - nbytes); in xctr_encrypt()
502 struct skcipher_walk walk; in ctr_encrypt() local
504 err = skcipher_walk_virt(&walk, req, false); in ctr_encrypt()
506 while (walk.nbytes > 0) { in ctr_encrypt()
507 const u8 *src = walk.src.virt.addr; in ctr_encrypt()
508 unsigned int nbytes = walk.nbytes; in ctr_encrypt()
509 u8 *dst = walk.dst.virt.addr; in ctr_encrypt()
523 else if (nbytes < walk.total) in ctr_encrypt()
528 walk.iv); in ctr_encrypt()
532 memcpy(walk.dst.virt.addr, in ctr_encrypt()
535 err = skcipher_walk_done(&walk, walk.nbytes - nbytes); in ctr_encrypt()
550 struct skcipher_walk walk; in xts_encrypt() local
555 err = skcipher_walk_virt(&walk, req, false); in xts_encrypt()
557 if (unlikely(tail > 0 && walk.nbytes < walk.total)) { in xts_encrypt()
561 skcipher_walk_abort(&walk); in xts_encrypt()
571 err = skcipher_walk_virt(&walk, req, false); in xts_encrypt()
576 for (first = 1; walk.nbytes >= AES_BLOCK_SIZE; first = 0) { in xts_encrypt()
577 int nbytes = walk.nbytes; in xts_encrypt()
579 if (walk.nbytes < walk.total) in xts_encrypt()
583 aes_xts_encrypt(walk.dst.virt.addr, walk.src.virt.addr, in xts_encrypt()
585 ctx->key2.key_enc, walk.iv, first); in xts_encrypt()
587 err = skcipher_walk_done(&walk, walk.nbytes - nbytes); in xts_encrypt()
600 err = skcipher_walk_virt(&walk, &subreq, false); in xts_encrypt()
605 aes_xts_encrypt(walk.dst.virt.addr, walk.src.virt.addr, in xts_encrypt()
606 ctx->key1.key_enc, rounds, walk.nbytes, in xts_encrypt()
607 ctx->key2.key_enc, walk.iv, first); in xts_encrypt()
610 return skcipher_walk_done(&walk, 0); in xts_encrypt()
622 struct skcipher_walk walk; in xts_decrypt() local
627 err = skcipher_walk_virt(&walk, req, false); in xts_decrypt()
629 if (unlikely(tail > 0 && walk.nbytes < walk.total)) { in xts_decrypt()
633 skcipher_walk_abort(&walk); in xts_decrypt()
643 err = skcipher_walk_virt(&walk, req, false); in xts_decrypt()
648 for (first = 1; walk.nbytes >= AES_BLOCK_SIZE; first = 0) { in xts_decrypt()
649 int nbytes = walk.nbytes; in xts_decrypt()
651 if (walk.nbytes < walk.total) in xts_decrypt()
655 aes_xts_decrypt(walk.dst.virt.addr, walk.src.virt.addr, in xts_decrypt()
657 ctx->key2.key_enc, walk.iv, first); in xts_decrypt()
659 err = skcipher_walk_done(&walk, walk.nbytes - nbytes); in xts_decrypt()
672 err = skcipher_walk_virt(&walk, &subreq, false); in xts_decrypt()
678 aes_xts_decrypt(walk.dst.virt.addr, walk.src.virt.addr, in xts_decrypt()
679 ctx->key1.key_dec, rounds, walk.nbytes, in xts_decrypt()
680 ctx->key2.key_enc, walk.iv, first); in xts_decrypt()
683 return skcipher_walk_done(&walk, 0); in xts_decrypt()