aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-10-08 18:06:37 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-08 18:06:37 +0200
commit3882caadbd9eb6b3b1497017f519252410f2b6c9 (patch)
treec3a9f2169e21520a93794d175f4a67d26cd69d9f
parentallowedips: remove control statement from macro by rewriting (diff)
downloadWireGuard-jd/bigendiancurve.tar.xz
WireGuard-jd/bigendiancurve.zip
curve25519-arm: simply call setendjd/bigendiancurve
Probably not good if this runs on a v8 CPU.
-rw-r--r--src/crypto/zinc/curve25519/curve25519-arm-glue.c3
-rw-r--r--src/crypto/zinc/curve25519/curve25519-arm.S5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/crypto/zinc/curve25519/curve25519-arm-glue.c b/src/crypto/zinc/curve25519/curve25519-arm-glue.c
index c71c981..a2167c2 100644
--- a/src/crypto/zinc/curve25519/curve25519-arm-glue.c
+++ b/src/crypto/zinc/curve25519/curve25519-arm-glue.c
@@ -26,8 +26,7 @@ static inline bool curve25519_arch(u8 mypublic[CURVE25519_KEY_SIZE],
bool used_arch = false;
simd_get(&simd_context);
- if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) &&
- !IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) && curve25519_use_neon &&
+ if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && curve25519_use_neon &&
simd_use(&simd_context)) {
curve25519_neon(mypublic, secret, basepoint);
used_arch = true;
diff --git a/src/crypto/zinc/curve25519/curve25519-arm.S b/src/crypto/zinc/curve25519/curve25519-arm.S
index b63ac48..df9ceee 100644
--- a/src/crypto/zinc/curve25519/curve25519-arm.S
+++ b/src/crypto/zinc/curve25519/curve25519-arm.S
@@ -7,8 +7,9 @@
* manually reworked for use in kernel space.
*/
-#if defined(CONFIG_KERNEL_MODE_NEON) && !defined(__ARMEB__)
+#if defined(CONFIG_KERNEL_MODE_NEON)
#include <linux/linkage.h>
+#include <asm/assembler.h>
.text
.fpu neon
@@ -18,6 +19,7 @@
ENTRY(curve25519_neon)
push {r4-r11, lr}
mov ip, sp
+ARM_BE8(setend le)
sub r3, sp, #704
and r3, r3, #0xfffffff0
mov sp, r3
@@ -2058,6 +2060,7 @@ ENTRY(curve25519_neon)
str r8, [r0, #24]
str r1, [r0, #28]
movw r0, #0
+ARM_BE8(setend be)
mov sp, ip
pop {r4-r11, pc}
ENDPROC(curve25519_neon)