ge25519.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* $OpenBSD: ge25519.h,v 1.4 2015/02/16 18:26:26 miod Exp $ */
  2. /*
  3. * Public Domain, Authors: Daniel J. Bernstein, Niels Duif, Tanja Lange,
  4. * Peter Schwabe, Bo-Yin Yang.
  5. * Copied from supercop-20130419/crypto_sign/ed25519/ref/ge25519.h
  6. */
  7. #ifndef GE25519_H
  8. #define GE25519_H
  9. #include "fe25519.h"
  10. #include "sc25519.h"
  11. #define ge25519 crypto_sign_ed25519_ref_ge25519
  12. #define ge25519_base crypto_sign_ed25519_ref_ge25519_base
  13. #define ge25519_unpackneg_vartime crypto_sign_ed25519_ref_unpackneg_vartime
  14. #define ge25519_pack crypto_sign_ed25519_ref_pack
  15. #define ge25519_isneutral_vartime crypto_sign_ed25519_ref_isneutral_vartime
  16. #define ge25519_double_scalarmult_vartime crypto_sign_ed25519_ref_double_scalarmult_vartime
  17. #define ge25519_scalarmult_base crypto_sign_ed25519_ref_scalarmult_base
  18. typedef struct
  19. {
  20. fe25519 x;
  21. fe25519 y;
  22. fe25519 z;
  23. fe25519 t;
  24. } ge25519;
  25. extern const ge25519 ge25519_base;
  26. int ge25519_unpackneg_vartime(ge25519 *r, const unsigned char p[32]);
  27. void ge25519_pack(unsigned char r[32], const ge25519 *p);
  28. int ge25519_isneutral_vartime(const ge25519 *p);
  29. void ge25519_double_scalarmult_vartime(ge25519 *r, const ge25519 *p1, const sc25519 *s1, const ge25519 *p2, const sc25519 *s2);
  30. void ge25519_scalarmult_base(ge25519 *r, const sc25519 *s);
  31. #endif