Skip to content

Commit 9d4204a

Browse files
committed
lib/crypto/poly1305: Fix arm64's poly1305_blocks_arch()
For some reason arm64's Poly1305 code got changed to ignore the padbit argument. As a result, the output is incorrect when the message length is not a multiple of 16 (which is not reached with the standard ChaCha20Poly1305, but bcachefs could reach this). Fix this. Fixes: a59e546 ("crypto: arm64/poly1305 - Add block-only interface") Reported-by: Kent Overstreet <[email protected]> Tested-by: Kent Overstreet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 2f13dae commit 9d4204a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/lib/crypto/poly1305-glue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ void poly1305_blocks_arch(struct poly1305_block_state *state, const u8 *src,
3838
unsigned int todo = min_t(unsigned int, len, SZ_4K);
3939

4040
kernel_neon_begin();
41-
poly1305_blocks_neon(state, src, todo, 1);
41+
poly1305_blocks_neon(state, src, todo, padbit);
4242
kernel_neon_end();
4343

4444
len -= todo;
4545
src += todo;
4646
} while (len);
4747
} else
48-
poly1305_blocks(state, src, len, 1);
48+
poly1305_blocks(state, src, len, padbit);
4949
}
5050
EXPORT_SYMBOL_GPL(poly1305_blocks_arch);
5151

0 commit comments

Comments
 (0)