diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-27 14:37:31 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-05-28 11:23:18 +0800 |
commit | 239c934a33529b995f475d8e681b0b1706af2f18 (patch) | |
tree | dc5771b5bf028ff6417f10f34d9a84718e2be852 /crypto/echainiv.c | |
parent | b77e06fec867aa0451b6a80ad0dd5f298c5da04a (diff) | |
download | linux-crypto-239c934a33529b995f475d8e681b0b1706af2f18.tar.gz linux-crypto-239c934a33529b995f475d8e681b0b1706af2f18.zip |
crypto: echainiv - Copy AD along with plain text
As the AD does not necessarily exist in the destination buffer
it must be copied along with the plain text.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | crypto/echainiv.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/crypto/echainiv.c b/crypto/echainiv.c index bd85dcc4..02d05430 100644 --- a/crypto/echainiv.c +++ b/crypto/echainiv.c @@ -228,19 +228,13 @@ static int echainiv_encrypt(struct aead_request *req) info = req->iv; if (req->src != req->dst) { - struct scatterlist src[2]; - struct scatterlist dst[2]; struct blkcipher_desc desc = { .tfm = ctx->null, }; err = crypto_blkcipher_encrypt( - &desc, - scatterwalk_ffwd(dst, req->dst, - req->assoclen + ivsize), - scatterwalk_ffwd(src, req->src, - req->assoclen + ivsize), - req->cryptlen - ivsize); + &desc, req->dst, req->src, + req->assoclen + req->cryptlen); if (err) return err; } |