curve25519.c 892 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: GPL-2.0 OR MIT
  2. /*
  3. * Copyright (C) 2015-2019 Jason A. Donenfeld <[email protected]>. 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. #include <crypto/curve25519.h>
  12. #include <linux/module.h>
  13. #include <linux/init.h>
  14. static int __init curve25519_init(void)
  15. {
  16. if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS) &&
  17. WARN_ON(!curve25519_selftest()))
  18. return -ENODEV;
  19. return 0;
  20. }
  21. static void __exit curve25519_exit(void)
  22. {
  23. }
  24. module_init(curve25519_init);
  25. module_exit(curve25519_exit);
  26. MODULE_LICENSE("GPL v2");
  27. MODULE_DESCRIPTION("Curve25519 scalar multiplication");
  28. MODULE_AUTHOR("Jason A. Donenfeld <[email protected]>");