curve25519.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * cifra - embedded cryptography library
  3. * Written in 2014 by Joseph Birr-Pixton <jpixton@gmail.com>
  4. *
  5. * To the extent possible under law, the author(s) have dedicated all
  6. * copyright and related and neighboring rights to this software to the
  7. * public domain worldwide. This software is distributed without any
  8. * warranty.
  9. *
  10. * You should have received a copy of the CC0 Public Domain Dedication
  11. * along with this software. If not, see
  12. * <http://creativecommons.org/publicdomain/zero/1.0/>.
  13. */
  14. #ifndef CURVE25519_H
  15. #define CURVE25519_H
  16. #include <stddef.h>
  17. #include <stdint.h>
  18. /**
  19. * Curve25519
  20. * ==========
  21. * This is `curve25519 <http://cr.yp.to/ecdh.html>`_ with switchable
  22. * implementations underneath.
  23. *
  24. * By default tweetnacl is used on hosts, and the implementation
  25. * from μNaCl for Cortex-M0, M3 and M4.
  26. */
  27. /* .. c:function:: $DECL
  28. * Multiplies `point` by `scalar`, putting the resulting point into `out`. */
  29. void cf_curve25519_mul(uint8_t out[32],
  30. const uint8_t scalar[32],
  31. const uint8_t point[32]);
  32. /* .. c:function:: $DECL
  33. * Multiplies `scalar` by the curve25519 base point, putting the resulting
  34. * point into `out`. */
  35. void cf_curve25519_mul_base(uint8_t out[32], const uint8_t scalar[32]);
  36. #endif