Lines Matching refs:walk

282 	struct skcipher_walk walk;  in ecb_encrypt()  local
286 err = skcipher_walk_virt(&walk, req, false); in ecb_encrypt()
288 while ((nbytes = walk.nbytes)) { in ecb_encrypt()
290 aesni_ecb_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr, in ecb_encrypt()
294 err = skcipher_walk_done(&walk, nbytes); in ecb_encrypt()
304 struct skcipher_walk walk; in ecb_decrypt() local
308 err = skcipher_walk_virt(&walk, req, false); in ecb_decrypt()
310 while ((nbytes = walk.nbytes)) { in ecb_decrypt()
312 aesni_ecb_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr, in ecb_decrypt()
316 err = skcipher_walk_done(&walk, nbytes); in ecb_decrypt()
326 struct skcipher_walk walk; in cbc_encrypt() local
330 err = skcipher_walk_virt(&walk, req, false); in cbc_encrypt()
332 while ((nbytes = walk.nbytes)) { in cbc_encrypt()
334 aesni_cbc_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr, in cbc_encrypt()
335 nbytes & AES_BLOCK_MASK, walk.iv); in cbc_encrypt()
338 err = skcipher_walk_done(&walk, nbytes); in cbc_encrypt()
348 struct skcipher_walk walk; in cbc_decrypt() local
352 err = skcipher_walk_virt(&walk, req, false); in cbc_decrypt()
354 while ((nbytes = walk.nbytes)) { in cbc_decrypt()
356 aesni_cbc_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr, in cbc_decrypt()
357 nbytes & AES_BLOCK_MASK, walk.iv); in cbc_decrypt()
360 err = skcipher_walk_done(&walk, nbytes); in cbc_decrypt()
374 struct skcipher_walk walk; in cts_cbc_encrypt() local
410 err = skcipher_walk_virt(&walk, &subreq, false); in cts_cbc_encrypt()
415 aesni_cts_cbc_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr, in cts_cbc_encrypt()
416 walk.nbytes, walk.iv); in cts_cbc_encrypt()
419 return skcipher_walk_done(&walk, 0); in cts_cbc_encrypt()
430 struct skcipher_walk walk; in cts_cbc_decrypt() local
466 err = skcipher_walk_virt(&walk, &subreq, false); in cts_cbc_decrypt()
471 aesni_cts_cbc_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr, in cts_cbc_decrypt()
472 walk.nbytes, walk.iv); in cts_cbc_decrypt()
475 return skcipher_walk_done(&walk, 0); in cts_cbc_decrypt()
501 struct skcipher_walk walk; in ctr_crypt() local
505 err = skcipher_walk_virt(&walk, req, false); in ctr_crypt()
507 while ((nbytes = walk.nbytes) > 0) { in ctr_crypt()
510 static_call(aesni_ctr_enc_tfm)(ctx, walk.dst.virt.addr, in ctr_crypt()
511 walk.src.virt.addr, in ctr_crypt()
513 walk.iv); in ctr_crypt()
516 if (walk.nbytes == walk.total && nbytes > 0) { in ctr_crypt()
517 aesni_enc(ctx, keystream, walk.iv); in ctr_crypt()
518 crypto_xor_cpy(walk.dst.virt.addr + walk.nbytes - nbytes, in ctr_crypt()
519 walk.src.virt.addr + walk.nbytes - nbytes, in ctr_crypt()
521 crypto_inc(walk.iv, AES_BLOCK_SIZE); in ctr_crypt()
525 err = skcipher_walk_done(&walk, nbytes); in ctr_crypt()
613 struct skcipher_walk walk; in gcmaes_crypt_by_sg() local
658 err = enc ? skcipher_walk_aead_encrypt(&walk, req, false) in gcmaes_crypt_by_sg()
659 : skcipher_walk_aead_decrypt(&walk, req, false); in gcmaes_crypt_by_sg()
661 while (walk.nbytes > 0) { in gcmaes_crypt_by_sg()
666 walk.dst.virt.addr, in gcmaes_crypt_by_sg()
667 walk.src.virt.addr, in gcmaes_crypt_by_sg()
668 walk.nbytes); in gcmaes_crypt_by_sg()
671 walk.dst.virt.addr, in gcmaes_crypt_by_sg()
672 walk.src.virt.addr, in gcmaes_crypt_by_sg()
673 walk.nbytes); in gcmaes_crypt_by_sg()
677 walk.dst.virt.addr, in gcmaes_crypt_by_sg()
678 walk.src.virt.addr, in gcmaes_crypt_by_sg()
679 walk.nbytes); in gcmaes_crypt_by_sg()
682 walk.dst.virt.addr, in gcmaes_crypt_by_sg()
683 walk.src.virt.addr, in gcmaes_crypt_by_sg()
684 walk.nbytes); in gcmaes_crypt_by_sg()
686 aesni_gcm_enc_update(aes_ctx, data, walk.dst.virt.addr, in gcmaes_crypt_by_sg()
687 walk.src.virt.addr, walk.nbytes); in gcmaes_crypt_by_sg()
689 aesni_gcm_dec_update(aes_ctx, data, walk.dst.virt.addr, in gcmaes_crypt_by_sg()
690 walk.src.virt.addr, walk.nbytes); in gcmaes_crypt_by_sg()
694 err = skcipher_walk_done(&walk, 0); in gcmaes_crypt_by_sg()
845 struct skcipher_walk walk; in xts_crypt() local
851 err = skcipher_walk_virt(&walk, req, false); in xts_crypt()
852 if (!walk.nbytes) in xts_crypt()
855 if (unlikely(tail > 0 && walk.nbytes < walk.total)) { in xts_crypt()
858 skcipher_walk_abort(&walk); in xts_crypt()
868 err = skcipher_walk_virt(&walk, req, false); in xts_crypt()
869 if (!walk.nbytes) in xts_crypt()
878 aesni_enc(aes_ctx(ctx->raw_tweak_ctx), walk.iv, walk.iv); in xts_crypt()
880 while (walk.nbytes > 0) { in xts_crypt()
881 int nbytes = walk.nbytes; in xts_crypt()
883 if (nbytes < walk.total) in xts_crypt()
888 walk.dst.virt.addr, walk.src.virt.addr, in xts_crypt()
889 nbytes, walk.iv); in xts_crypt()
892 walk.dst.virt.addr, walk.src.virt.addr, in xts_crypt()
893 nbytes, walk.iv); in xts_crypt()
896 err = skcipher_walk_done(&walk, walk.nbytes - nbytes); in xts_crypt()
898 if (walk.nbytes > 0) in xts_crypt()
913 err = skcipher_walk_virt(&walk, &subreq, false); in xts_crypt()
920 walk.dst.virt.addr, walk.src.virt.addr, in xts_crypt()
921 walk.nbytes, walk.iv); in xts_crypt()
924 walk.dst.virt.addr, walk.src.virt.addr, in xts_crypt()
925 walk.nbytes, walk.iv); in xts_crypt()
928 err = skcipher_walk_done(&walk, 0); in xts_crypt()