aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-28 14:49:47 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-28 14:49:47 +0100
commit88624d4353f1073f170337212294827e50e01324 (patch)
tree7bd73bb5527c233615b5e8a60295d4471c393521 /src
parentcompat: support RAP in assembly (diff)
downloadwireguard-monolithic-historical-88624d4353f1073f170337212294827e50e01324.tar.xz
wireguard-monolithic-historical-88624d4353f1073f170337212294827e50e01324.zip
curve25519: explictly depend on AS_AVX
Diffstat (limited to 'src')
-rw-r--r--src/crypto/curve25519.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/crypto/curve25519.c b/src/crypto/curve25519.c
index 7b40b61..6dbd74b 100644
--- a/src/crypto/curve25519.c
+++ b/src/crypto/curve25519.c
@@ -23,7 +23,7 @@ static __always_inline void normalize_secret(u8 secret[CURVE25519_POINT_SIZE])
secret[31] |= 64;
}
-#if defined(CONFIG_X86_64)
+#if defined(CONFIG_X86_64) && defined(CONFIG_AS_AVX)
#include <asm/cpufeature.h>
#include <asm/processor.h>
#include <asm/fpu/api.h>
@@ -1638,7 +1638,7 @@ static const u8 null_point[CURVE25519_POINT_SIZE] = { 0 };
bool curve25519(u8 mypublic[CURVE25519_POINT_SIZE], const u8 secret[CURVE25519_POINT_SIZE], const u8 basepoint[CURVE25519_POINT_SIZE])
{
bool ret = true;
-#if defined(CONFIG_X86_64)
+#if defined(CONFIG_X86_64) && defined(CONFIG_AS_AVX)
if (curve25519_use_avx && irq_fpu_usable()) {
kernel_fpu_begin();
curve25519_sandy2x(mypublic, secret, basepoint);
@@ -1666,7 +1666,7 @@ bool curve25519_generate_public(u8 pub[CURVE25519_POINT_SIZE], const u8 secret[C
if (unlikely(!crypto_memneq(secret, null_point, CURVE25519_POINT_SIZE)))
return false;
-#if defined(CONFIG_X86_64)
+#if defined(CONFIG_X86_64) && defined(CONFIG_AS_AVX)
if (curve25519_use_avx && irq_fpu_usable()) {
kernel_fpu_begin();
curve25519_sandy2x_base(pub, secret);