]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lib/crypto: x86/sha1-ni: Convert to use rounds macros
authorEric Biggers <ebiggers@kernel.org>
Fri, 18 Jul 2025 19:19:00 +0000 (12:19 -0700)
committerEric Biggers <ebiggers@kernel.org>
Mon, 21 Jul 2025 04:42:42 +0000 (21:42 -0700)
commit42e3376e0954d7e589e5a53d6149835cad64e8e6
treee19055e0addaf835543c0e4df000cc1d3c996e79
parentf88ed14aa0ef64ff5633605114efe313a0bed84b
lib/crypto: x86/sha1-ni: Convert to use rounds macros

The assembly code that does all 80 rounds of SHA-1 is highly repetitive.
Replace it with 20 expansions of a macro that does 4 rounds, using the
macro arguments and .if directives to handle the slight variations
between rounds.  This reduces the length of sha1-ni-asm.S by 129 lines
while still producing the exact same object file.  This mirrors
sha256-ni-asm.S which uses this same strategy.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250718191900.42877-3-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
lib/crypto/x86/sha1-ni-asm.S