Skip to content

Commit 44e8241

Browse files
author
Eric Biggers
committed
lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN
On big endian arm kernels, the arm optimized Curve25519 code produces incorrect outputs and fails the Curve25519 test. This has been true ever since this code was added. It seems that hardly anyone (or even no one?) actually uses big endian arm kernels. But as long as they're ostensibly supported, we should disable this code on them so that it's not accidentally used. Note: for future-proofing, use !CPU_BIG_ENDIAN instead of CPU_LITTLE_ENDIAN. Both of these are arch-specific options that could get removed in the future if big endian support gets dropped. Fixes: d8f1308 ("crypto: arm/curve25519 - wire up NEON implementation") Cc: stable@vger.kernel.org Acked-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20251104054906.716914-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent 2b81082 commit 44e8241

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/crypto/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ config CRYPTO_LIB_CURVE25519
6464
config CRYPTO_LIB_CURVE25519_ARCH
6565
bool
6666
depends on CRYPTO_LIB_CURVE25519 && !UML && !KMSAN
67-
default y if ARM && KERNEL_MODE_NEON
67+
default y if ARM && KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
6868
default y if PPC64 && CPU_LITTLE_ENDIAN
6969
default y if X86_64
7070

0 commit comments

Comments
 (0)