diff options
| author | Jiri Kosina <[email protected]> | 2020-04-01 12:26:12 +0200 |
|---|---|---|
| committer | Jiri Kosina <[email protected]> | 2020-04-01 12:26:12 +0200 |
| commit | c9f289701540baeef9ac7c9977d67a7259f404db (patch) | |
| tree | ac3c29d41da02ac735c9a12da78905842fbccd2f /lib/crypto/curve25519.c | |
| parent | 0aac6f9aaae5fba08963651d2ce49930145e118f (diff) | |
| parent | 910a7e89cec65efad254c947ce2bf8bf5b370962 (diff) | |
Merge branch 'for-5.7/appleir' into for-linus
- small code cleanups in hid-appleir from Lucas Tanure
Diffstat (limited to 'lib/crypto/curve25519.c')
| -rw-r--r-- | lib/crypto/curve25519.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/crypto/curve25519.c b/lib/crypto/curve25519.c index 0106bebe6900..288a62cd29b2 100644 --- a/lib/crypto/curve25519.c +++ b/lib/crypto/curve25519.c @@ -13,12 +13,22 @@ #include <linux/module.h> #include <linux/init.h> -const u8 curve25519_null_point[CURVE25519_KEY_SIZE] __aligned(32) = { 0 }; -const u8 curve25519_base_point[CURVE25519_KEY_SIZE] __aligned(32) = { 9 }; +bool curve25519_selftest(void); -EXPORT_SYMBOL(curve25519_null_point); -EXPORT_SYMBOL(curve25519_base_point); -EXPORT_SYMBOL(curve25519_generic); +static int __init mod_init(void) +{ + if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) && + WARN_ON(!curve25519_selftest())) + return -ENODEV; + return 0; +} + +static void __exit mod_exit(void) +{ +} + +module_init(mod_init); +module_exit(mod_exit); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("Curve25519 scalar multiplication"); |