aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/zinc/curve25519
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-22 07:12:39 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-23 17:05:23 +0200
commitb715e3befb5ad153fc71d8b8dfec1c05ea1af1f8 (patch)
tree274112a37ab0ce115ee752eaf7fe967f2a273f20 /src/crypto/zinc/curve25519
parentglobal: reduce stack frame size (diff)
downloadwireguard-monolithic-historical-b715e3befb5ad153fc71d8b8dfec1c05ea1af1f8.tar.xz
wireguard-monolithic-historical-b715e3befb5ad153fc71d8b8dfec1c05ea1af1f8.zip
crypto-arm: rework KERNEL_MODE_NEON handling
It might be defined even if the compiler doesn't support it.
Diffstat (limited to 'src/crypto/zinc/curve25519')
-rw-r--r--src/crypto/zinc/curve25519/curve25519-arm-glue.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/crypto/zinc/curve25519/curve25519-arm-glue.h b/src/crypto/zinc/curve25519/curve25519-arm-glue.h
index 27d387e..e9496b0 100644
--- a/src/crypto/zinc/curve25519/curve25519-arm-glue.h
+++ b/src/crypto/zinc/curve25519/curve25519-arm-glue.h
@@ -7,8 +7,12 @@
#include <asm/neon.h>
#include <asm/simd.h>
-#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && __LINUX_ARM_ARCH__ == 7
-#define ARM_USE_NEON
+#define ARM_USE_NEON (defined(CONFIG_KERNEL_MODE_NEON) && \
+ (defined(CONFIG_ARM64) || \
+ (defined(__LINUX_ARM_ARCH__) && \
+ __LINUX_ARM_ARCH__ == 7)))
+
+#if ARM_USE_NEON
asmlinkage void curve25519_neon(u8 mypublic[CURVE25519_POINT_SIZE],
const u8 secret[CURVE25519_POINT_SIZE],
const u8 basepoint[CURVE25519_POINT_SIZE]);
@@ -25,7 +29,7 @@ static inline bool curve25519_arch(u8 mypublic[CURVE25519_POINT_SIZE],
const u8 secret[CURVE25519_POINT_SIZE],
const u8 basepoint[CURVE25519_POINT_SIZE])
{
-#ifdef ARM_USE_NEON
+#if ARM_USE_NEON
if (curve25519_use_neon && may_use_simd()) {
kernel_neon_begin();
curve25519_neon(mypublic, secret, basepoint);