[PATCH 4/9] lib/crypto: arm64/poly1305: Remove obsolete chunking logic

Eric Biggers
2026-04-01T00:07:50Z

Simplify the Poly1305 code accordingly.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
lib/crypto/arm64/poly1305.h | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/lib/crypto/arm64/poly1305.h b/lib/crypto/arm64/poly1305.h
index b77669767cd6..3d4bde857699 100644
--- a/lib/crypto/arm64/poly1305.h
+++ b/lib/crypto/arm64/poly1305.h
@@ -25,21 +25,15 @@ static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);

static void poly1305_blocks(struct poly1305_block_state *state, const u8 *src,
unsigned int len, u32 padbit)
{
if (static_branch_likely(&have_neon) && likely(may_use_simd())) {
- do {
- unsigned int todo = min_t(unsigned int, len, SZ_4K);
-
- scoped_ksimd()
- poly1305_blocks_neon(state, src, todo, padbit);
-
- len -= todo;
- src += todo;
- } while (len);
- } else
+ scoped_ksimd()
+ poly1305_blocks_neon(state, src, len, padbit);
+ } else {
poly1305_blocks_arm64(state, src, len, padbit);
+ }
}

#define poly1305_mod_init_arch poly1305_mod_init_arch
static void poly1305_mod_init_arch(void)
{
--
2.53.0