aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/zinc/curve25519/curve25519.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-18 02:18:47 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-18 04:21:16 +0200
commitf0ea799b1b0e920e4fd00d977dffa240f527bbee (patch)
treef86425e432311c170a5d5daf76c52c514ec3c3ef /src/crypto/zinc/curve25519/curve25519.c
parentchacha20-x86_64: more limited cascade (diff)
downloadwireguard-linux-compat-f0ea799b1b0e920e4fd00d977dffa240f527bbee.tar.xz
wireguard-linux-compat-f0ea799b1b0e920e4fd00d977dffa240f527bbee.zip
crypto: allow for disabling simd in zinc modules
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/zinc/curve25519/curve25519.c')
-rw-r--r--src/crypto/zinc/curve25519/curve25519.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/crypto/zinc/curve25519/curve25519.c b/src/crypto/zinc/curve25519/curve25519.c
index fca327f..a02070e 100644
--- a/src/crypto/zinc/curve25519/curve25519.c
+++ b/src/crypto/zinc/curve25519/curve25519.c
@@ -88,13 +88,16 @@ EXPORT_SYMBOL(curve25519_generate_secret);
#include "../selftest/curve25519.h"
+static bool nosimd __initdata = false;
+
#ifndef COMPAT_ZINC_IS_A_MODULE
int __init curve25519_mod_init(void)
#else
static int __init mod_init(void)
#endif
{
- curve25519_fpu_init();
+ if (!nosimd)
+ curve25519_fpu_init();
#ifdef DEBUG
if (!curve25519_selftest())
return -ENOTRECOVERABLE;
@@ -107,6 +110,7 @@ static void __exit mod_exit(void)
{
}
+module_param(nosimd, bool, 0);
module_init(mod_init);
module_exit(mod_exit);
MODULE_LICENSE("GPL v2");