summaryrefslogtreecommitdiffhomepage
path: root/src/crypto/zinc/curve25519
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-27 00:28:47 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-02 03:41:49 +0200
commitcfa6a82310de91038a153a2b5d011d5f08573285 (patch)
treee4bfddbd855be754b3bb6e9453f8e25d8dcdad38 /src/crypto/zinc/curve25519
parentae383dd701c0f27349893d4fbd48c7b72a39b92a (diff)
crypto: prefer IS_ENABLED to ifdefs
Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/zinc/curve25519')
-rw-r--r--src/crypto/zinc/curve25519/curve25519-arm-glue.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/crypto/zinc/curve25519/curve25519-arm-glue.h b/src/crypto/zinc/curve25519/curve25519-arm-glue.h
index 7969fec..1e6769c 100644
--- a/src/crypto/zinc/curve25519/curve25519-arm-glue.h
+++ b/src/crypto/zinc/curve25519/curve25519-arm-glue.h
@@ -7,11 +7,9 @@
#include <asm/neon.h>
#include <asm/simd.h>
-#if defined(CONFIG_KERNEL_MODE_NEON) && !defined(CONFIG_CPU_BIG_ENDIAN)
asmlinkage void curve25519_neon(u8 mypublic[CURVE25519_KEY_SIZE],
const u8 secret[CURVE25519_KEY_SIZE],
const u8 basepoint[CURVE25519_KEY_SIZE]);
-#endif
static bool curve25519_use_neon __ro_after_init;
@@ -24,14 +22,14 @@ static inline bool curve25519_arch(u8 mypublic[CURVE25519_KEY_SIZE],
const u8 secret[CURVE25519_KEY_SIZE],
const u8 basepoint[CURVE25519_KEY_SIZE])
{
-#if defined(CONFIG_KERNEL_MODE_NEON) && !defined(CONFIG_CPU_BIG_ENDIAN)
- if (curve25519_use_neon && may_use_simd()) {
+ if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) &&
+ !IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) && curve25519_use_neon &&
+ may_use_simd()) {
kernel_neon_begin();
curve25519_neon(mypublic, secret, basepoint);
kernel_neon_end();
return true;
}
-#endif
return false;
}