summaryrefslogtreecommitdiffhomepage
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
commite1a0f851e2848d428ec5c30eaaea67e2691fe4bb (patch)
tree1f0c8e9135eaa515678689c7b386eb510fe11b27 /src
parent26f10d8fbd04641a79433fc29b2cef80a972ac69 (diff)
curve25519: explictly depend on AS_AVX
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
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);