Skip to contentSkip to conversation

lib/crypto: arm/curve25519: Disable on CPU_BIG_ENDIAN

PATCH In review Eric Biggers 2 participants 8 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 f87e63b2212e..df2ae5c6af95 100644
@@ -2,11 +2,11 @@
 
 menu "Accelerated Cryptographic Algorithms for CPU (arm)"
 
 config CRYPTO_CURVE25519_NEON
 	tristate
-	depends on KERNEL_MODE_NEON
+	depends on KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
 	select CRYPTO_KPP
 	select CRYPTO_LIB_CURVE25519_GENERIC
 	select CRYPTO_ARCH_HAVE_LIB_CURVE25519
 	default CRYPTO_LIB_CURVE25519_INTERNAL
 	help

base-commit: 8a243ecde1f6447b8e237f2c1c67c0bb67d16d67

Signature · 1 line
2.51.2
maintainer
#1 lore raw

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

Thanks!

#2 lore raw
Quoted 3 lines · Sasha Levin

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

Thanks!

I assume that you meant to write something meaningful in this message. Also, you forgot to include all the original recipients in Cc.

- Eric

maintainer
#3 lore raw
Quoted 6 lines · Eric Biggers
Quoted 3 lines · Sasha Levin

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

Thanks!

I assume that you meant to write something meaningful in this message.

What else did you expect to see here?

Quoted 1 line

Also, you forgot to include all the original recipients in Cc.

Yes! I'm trying to automate this workflow, and this is one of the issues I've fixes with the scripts.

Signature · 2 lines
Thanks,
Sasha
#4 lore raw
Quoted 9 lines · Sasha Levin
Quoted 6 lines · Eric Biggers
Quoted 3 lines · Sasha Levin

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

Thanks!

I assume that you meant to write something meaningful in this message.

What else did you expect to see here?

Maybe some actual information that wasn't already in the email that you're replying to? What are you trying to accomplish?

- Eric

maintainer
#5 lore raw
Quoted 5 lines · Eric Biggers
Quoted 4 lines · Sasha Levin
Quoted 3 lines · Eric Biggers
Quoted 2 lines · Sasha Levin

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

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Thanks!

I assume that you meant to write something meaningful in this message.

What else did you expect to see here?

Maybe some actual information that wasn't already in the email that you're replying to? What are you trying to accomplish?

Letting you know that your backport was queued up?

"b4 ty"?

Do you want a pretty ascii art here?

_____ _ _ _ _ _

 |_   _|                                 | |                                        | |              | |                   | | | |
   | |     __ _ _   _  ___ _   _  ___  __| |  _   _ _ __    _   _  ___  _   _ _ __  | |__   __ _  ___| | ___ __   ___  _ __| |_| |
   | |    / _` | | | |/ _ \ | | |/ _ \/ _` | | | | | '_ \  | | | |/ _ \| | | | '__| | '_ \ / _` |/ __| |/ / '_ \ / _ \| '__| __| |
  _| |_  | (_| | |_| |  __/ |_| |  __/ (_| | | |_| | |_) | | |_| | (_) | |_| | |    | |_) | (_| | (__|   <| |_) | (_) | |  | |_|_|
 |_____|  \__, |\__,_|\___|\__,_|\___|\__,_|  \__,_| .__/   \__, |\___/ \__,_|_|    |_.__/ \__,_|\___|_|\_\ .__/ \___/|_|   \__(_)
             | |                                   | |       __/ |                                        | |                     
             |_|                                   |_|      |___/                                         |_|                     
Signature · 2 lines
Thanks,
Sasha
#6 lore raw
Quoted 8 lines · Sasha Levin
Quoted 7 lines · Eric Biggers
Quoted 6 lines · Sasha Levin
Quoted 5 lines · Eric Biggers
Quoted 3 lines · Sasha Levin

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

Thanks!

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I assume that you meant to write something meaningful in this message.

What else did you expect to see here?

Maybe some actual information that wasn't already in the email that you're replying to? What are you trying to accomplish?

Letting you know that your backport was queued up?

Maybe you should have mentioned that then?

- Eric

maintainer
#7 lore raw
Quoted 11 lines · Eric Biggers
Quoted 10 lines · Sasha Levin
Quoted 9 lines · Eric Biggers
Quoted 8 lines · Sasha Levin
Quoted 6 lines · Eric Biggers
Quoted 3 lines · Sasha Levin

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

Thanks!

I assume that you meant to write something meaningful in this message.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

What else did you expect to see here?

Maybe some actual information that wasn't already in the email that you're replying to? What are you trying to accomplish?

Letting you know that your backport was queued up?

Maybe you should have mentioned that then?

Oh!

Apparently if I call git-send-email with --subject, it'll still strip the first line from the patch file.

The first line was "This patch has been queued up for the ${KERNEL_VERSION} stable tree." :)

Thanks for pointing it out, I've fixed up the script.

Signature · 2 lines
Thanks,
Sasha