summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Kbuild5
-rw-r--r--src/crypto/curve25519-neon-arm.S6
-rw-r--r--src/crypto/curve25519.c6
3 files changed, 7 insertions, 10 deletions
diff --git a/src/Kbuild b/src/Kbuild
index 2ef4efd..810debe 100644
--- a/src/Kbuild
+++ b/src/Kbuild
@@ -21,10 +21,7 @@ ifeq ($(CONFIG_ARM64),y)
wireguard-$(CONFIG_KERNEL_MODE_NEON) += crypto/chacha20-neon-arm64.o
endif
ifeq ($(CONFIG_ARM),y)
- wireguard-$(CONFIG_KERNEL_MODE_NEON) += crypto/chacha20-neon-arm.o
- ifneq ($(CONFIG_CPU_THUMBONLY),y)
- wireguard-$(CONFIG_KERNEL_MODE_NEON) += crypto/curve25519-neon-arm.o
- endif
+ wireguard-$(CONFIG_KERNEL_MODE_NEON) += crypto/chacha20-neon-arm.o crypto/curve25519-neon-arm.o
endif
ifneq ($(KBUILD_EXTMOD),)
diff --git a/src/crypto/curve25519-neon-arm.S b/src/crypto/curve25519-neon-arm.S
index 1a921e2..b54211a 100644
--- a/src/crypto/curve25519-neon-arm.S
+++ b/src/crypto/curve25519-neon-arm.S
@@ -6,15 +6,15 @@
#include <linux/linkage.h>
.text
- .arm
.fpu neon
.align 4
ENTRY(curve25519_asm_neon)
vpush {q4,q5,q6,q7}
mov r12,sp
- sub sp,sp,#736
- and sp,sp,#0xffffffe0
+ sub r3,sp,#736
+ and r3,r3,#0xffffffe0
+ mov sp,r3
strd r4,[sp,#0]
strd r6,[sp,#8]
strd r8,[sp,#16]
diff --git a/src/crypto/curve25519.c b/src/crypto/curve25519.c
index 232c6d4..ddabfdf 100644
--- a/src/crypto/curve25519.c
+++ b/src/crypto/curve25519.c
@@ -192,7 +192,7 @@ static void curve25519_sandy2x_base(u8 pub[CURVE25519_POINT_SIZE], const u8 secr
memzero_explicit(x_51, sizeof(x_51));
memzero_explicit(z_51, sizeof(z_51));
}
-#elif IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM) && !defined(CONFIG_CPU_THUMBONLY)
+#elif IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM)
#include <asm/hwcap.h>
#include <asm/neon.h>
#include <asm/simd.h>
@@ -1470,7 +1470,7 @@ static void cmult(limb *resultx, limb *resultz, const u8 *n, const limb *q)
bool curve25519(u8 mypublic[CURVE25519_POINT_SIZE], const u8 secret[CURVE25519_POINT_SIZE], const u8 basepoint[CURVE25519_POINT_SIZE])
{
-#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM) && !defined(CONFIG_CPU_THUMBONLY)
+#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM)
if (curve25519_use_neon && may_use_simd()) {
kernel_neon_begin();
curve25519_asm_neon(mypublic, secret, basepoint);
@@ -1649,7 +1649,7 @@ static void cmult(struct other_stack *s, limb *resultx, limb *resultz, const u8
bool curve25519(u8 mypublic[CURVE25519_POINT_SIZE], const u8 secret[CURVE25519_POINT_SIZE], const u8 basepoint[CURVE25519_POINT_SIZE])
{
-#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM) && !defined(CONFIG_CPU_THUMBONLY)
+#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM)
if (curve25519_use_neon && may_use_simd()) {
kernel_neon_begin();
curve25519_asm_neon(mypublic, secret, basepoint);