18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 OR MIT
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * This is an implementation of the Curve25519 ECDH algorithm, using either
68c2ecf20Sopenharmony_ci * a 32-bit implementation or a 64-bit implementation with 128-bit integers,
78c2ecf20Sopenharmony_ci * depending on what is supported by the target compiler.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Information: https://cr.yp.to/ecdh.html
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <crypto/curve25519.h>
138c2ecf20Sopenharmony_ci#include <linux/module.h>
148c2ecf20Sopenharmony_ci#include <linux/init.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cibool curve25519_selftest(void);
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_cistatic int __init mod_init(void)
198c2ecf20Sopenharmony_ci{
208c2ecf20Sopenharmony_ci	if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) &&
218c2ecf20Sopenharmony_ci	    WARN_ON(!curve25519_selftest()))
228c2ecf20Sopenharmony_ci		return -ENODEV;
238c2ecf20Sopenharmony_ci	return 0;
248c2ecf20Sopenharmony_ci}
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cistatic void __exit mod_exit(void)
278c2ecf20Sopenharmony_ci{
288c2ecf20Sopenharmony_ci}
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_cimodule_init(mod_init);
318c2ecf20Sopenharmony_cimodule_exit(mod_exit);
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL v2");
348c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Curve25519 scalar multiplication");
358c2ecf20Sopenharmony_ciMODULE_AUTHOR("Jason A. Donenfeld <Jason@zx2c4.com>");
36