diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2014-03-04 13:28:39 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-03-10 20:17:11 +0800 |
commit | ac15546efedb59a56882fa6a415c554d10a0c32a (patch) | |
tree | 4c1fa799b7e5937b1b638cec0f2f6f3b1963610f | |
parent | d8a580d52eb2d210d214107d2acc96b83c7bc3c9 (diff) | |
download | linux-crypto-ac15546efedb59a56882fa6a415c554d10a0c32a.tar.gz linux-crypto-ac15546efedb59a56882fa6a415c554d10a0c32a.zip |
crypto: allow blkcipher walks over AEAD data
This adds the function blkcipher_aead_walk_virt_block, which allows the caller
to use the blkcipher walk API to handle the input and output scatterlists.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | crypto/blkcipher.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c index 46fdab5e..0122bec3 100644 --- a/crypto/blkcipher.c +++ b/crypto/blkcipher.c @@ -357,6 +357,20 @@ int blkcipher_walk_virt_block(struct blkcipher_desc *desc, } EXPORT_SYMBOL_GPL(blkcipher_walk_virt_block); +int blkcipher_aead_walk_virt_block(struct blkcipher_desc *desc, + struct blkcipher_walk *walk, + struct crypto_aead *tfm, + unsigned int blocksize) +{ + walk->flags &= ~BLKCIPHER_WALK_PHYS; + walk->walk_blocksize = blocksize; + walk->cipher_blocksize = crypto_aead_blocksize(tfm); + walk->ivsize = crypto_aead_ivsize(tfm); + walk->alignmask = crypto_aead_alignmask(tfm); + return blkcipher_walk_first(desc, walk); +} +EXPORT_SYMBOL_GPL(blkcipher_aead_walk_virt_block); + static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { |