diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2017-08-22 14:53:32 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-08-22 14:53:32 +0800 |
commit | 4be777cec4a84f99aac7f655d638c4c1bc0ade0e (patch) | |
tree | 065076d19888c1606a664edf3994a951da4c501b /crypto/chacha20_generic.c | |
parent | c1b1fa586429a5445ce480ddc75ed76568caef8f (diff) | |
parent | 4f673910a79f5cb0e7dd87bf807eebb24834cea3 (diff) | |
download | linux-crypto-4be777cec4a84f99aac7f655d638c4c1bc0ade0e.tar.gz linux-crypto-4be777cec4a84f99aac7f655d638c4c1bc0ade0e.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge the crypto tree to resolve the conflict between the temporary
and long-term fixes in algif_skcipher.
Diffstat (limited to '')
-rw-r--r-- | crypto/chacha20_generic.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/chacha20_generic.c b/crypto/chacha20_generic.c index 8b3c04d6..4a45fa48 100644 --- a/crypto/chacha20_generic.c +++ b/crypto/chacha20_generic.c @@ -91,9 +91,14 @@ int crypto_chacha20_crypt(struct skcipher_request *req) crypto_chacha20_init(state, ctx, walk.iv); while (walk.nbytes > 0) { + unsigned int nbytes = walk.nbytes; + + if (nbytes < walk.total) + nbytes = round_down(nbytes, walk.stride); + chacha20_docrypt(state, walk.dst.virt.addr, walk.src.virt.addr, - walk.nbytes); - err = skcipher_walk_done(&walk, 0); + nbytes); + err = skcipher_walk_done(&walk, walk.nbytes - nbytes); } return err; |