Jason A. Donenfeld | 0ed42a6f | 2019-11-08 13:22:32 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 OR MIT |
| 2 | /* |
| 3 | * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. |
| 4 | * |
| 5 | * This is an implementation of the Curve25519 ECDH algorithm, using either |
| 6 | * a 32-bit implementation or a 64-bit implementation with 128-bit integers, |
| 7 | * depending on what is supported by the target compiler. |
| 8 | * |
| 9 | * Information: https://cr.yp.to/ecdh.html |
| 10 | */ |
| 11 | |
| 12 | #include <crypto/curve25519.h> |
| 13 | #include <linux/module.h> |
| 14 | #include <linux/init.h> |
| 15 | |
Randy Dunlap | f03a3ca | 2021-07-11 15:31:45 -0700 | [diff] [blame] | 16 | static int __init curve25519_init(void) |
Jason A. Donenfeld | aa12796 | 2019-12-16 19:53:26 +0100 | [diff] [blame] | 17 | { |
| 18 | if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) && |
| 19 | WARN_ON(!curve25519_selftest())) |
| 20 | return -ENODEV; |
| 21 | return 0; |
| 22 | } |
| 23 | |
Randy Dunlap | f03a3ca | 2021-07-11 15:31:45 -0700 | [diff] [blame] | 24 | static void __exit curve25519_exit(void) |
Jason A. Donenfeld | aa12796 | 2019-12-16 19:53:26 +0100 | [diff] [blame] | 25 | { |
| 26 | } |
| 27 | |
Randy Dunlap | f03a3ca | 2021-07-11 15:31:45 -0700 | [diff] [blame] | 28 | module_init(curve25519_init); |
| 29 | module_exit(curve25519_exit); |
Jason A. Donenfeld | aa12796 | 2019-12-16 19:53:26 +0100 | [diff] [blame] | 30 | |
Jason A. Donenfeld | 0ed42a6f | 2019-11-08 13:22:32 +0100 | [diff] [blame] | 31 | MODULE_LICENSE("GPL v2"); |
| 32 | MODULE_DESCRIPTION("Curve25519 scalar multiplication"); |
| 33 | MODULE_AUTHOR("Jason A. Donenfeld <Jason@zx2c4.com>"); |