ed25519_donna.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. Public domain by Andrew M. <liquidsun@gmail.com>
  3. Modified from the amd64-51-30k implementation by
  4. Daniel J. Bernstein
  5. Niels Duif
  6. Tanja Lange
  7. Peter Schwabe
  8. Bo-Yin Yang
  9. */
  10. #ifndef ED25519_DONNA_H
  11. #define ED25519_DONNA_H
  12. #include "ed25519_donna_portable.h"
  13. #include "curve25519_donna_32bit.h"
  14. #include "curve25519_donna_helpers.h"
  15. #include "modm_donna_32bit.h"
  16. typedef unsigned char hash_512bits[64];
  17. /*
  18. * Arithmetic on the twisted Edwards curve -x^2 + y^2 = 1 + dx^2y^2
  19. * with d = -(121665/121666) = 37095705934669439343138083508754565189542113879843219016388785533085940283555
  20. * Base point: (15112221349535400772501151409588531511454012693041857206046113283949847762202,46316835694926478169428394003475163141307993866256225615783033603165251855960);
  21. */
  22. typedef struct ge25519_t {
  23. bignum25519 x, y, z, t;
  24. } ge25519;
  25. typedef struct ge25519_p1p1_t {
  26. bignum25519 x, y, z, t;
  27. } ge25519_p1p1;
  28. typedef struct ge25519_niels_t {
  29. bignum25519 ysubx, xaddy, t2d;
  30. } ge25519_niels;
  31. typedef struct ge25519_pniels_t {
  32. bignum25519 ysubx, xaddy, z, t2d;
  33. } ge25519_pniels;
  34. #include "ed25519_donna_basepoint_table.h"
  35. #include "ed25519_donna_32bit_tables.h"
  36. #include "ed25519_donna_impl_base.h"
  37. #endif