Skip to contentSkip to conversation

lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN

PATCH In review Eric Biggers 2 participants 2 messages Nov 11, 2025 – Nov 17, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN

commit 44e8241c51f762aafa50ed116da68fd6ecdcc954 upstream.

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 d8f1308a025f ("crypto: arm/curve25519 - wire up NEON implementation")
---
 arch/arm/crypto/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/crypto/Kconfig +1 -1
index 847b7a003356..1f684e29cff2 100644
@@ -2,11 +2,11 @@
 
 menu "Accelerated Cryptographic Algorithms for CPU (arm)"
 
 config CRYPTO_CURVE25519_NEON
 	tristate "Public key crypto: Curve25519 (NEON)"
-	depends on KERNEL_MODE_NEON
+	depends on KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
 	select CRYPTO_LIB_CURVE25519_GENERIC
 	select CRYPTO_ARCH_HAVE_LIB_CURVE25519
 	help
 	  Curve25519 algorithm
 

base-commit: 0a805b6ea8cda0caa268b396a2e5117f3772d849

Signature · 1 line
2.51.2
maintainer
#1 lore raw

Subject: lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN

Thanks!