diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-03-24 01:55:21 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-03-24 01:55:21 +0300 |
commit | 979e52ca0469fb38646bc51d26a0263a740c9f03 (patch) | |
tree | 30e74fe523f2114c76bce93863fec38955d58fa4 /arch/arm64 | |
parent | 16fbf79b0f83bc752cee8589279f1ebfe57b3b6e (diff) | |
parent | c8cfcb78c65877313cda7bcbace624d3dbd1f3b3 (diff) | |
download | linux-979e52ca0469fb38646bc51d26a0263a740c9f03.tar.xz |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu:
"This fixes a correctness bug in the ARM64 version of ChaCha for
lib/crypto used by WireGuard"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: arm64/chacha - correctly walk through blocks
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/crypto/chacha-neon-glue.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm64/crypto/chacha-neon-glue.c b/arch/arm64/crypto/chacha-neon-glue.c index c1f9660d104c..37ca3e889848 100644 --- a/arch/arm64/crypto/chacha-neon-glue.c +++ b/arch/arm64/crypto/chacha-neon-glue.c @@ -55,10 +55,10 @@ static void chacha_doneon(u32 *state, u8 *dst, const u8 *src, break; } chacha_4block_xor_neon(state, dst, src, nrounds, l); - bytes -= CHACHA_BLOCK_SIZE * 5; - src += CHACHA_BLOCK_SIZE * 5; - dst += CHACHA_BLOCK_SIZE * 5; - state[12] += 5; + bytes -= l; + src += l; + dst += l; + state[12] += DIV_ROUND_UP(l, CHACHA_BLOCK_SIZE); } } |