ed25519-donna.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef ED25519_H
  2. #define ED25519_H
  3. #include <stdlib.h>
  4. typedef unsigned char ed25519_signature[64];
  5. typedef unsigned char ed25519_public_key[32];
  6. typedef unsigned char ed25519_secret_key[32];
  7. typedef unsigned char curved25519_key[32];
  8. void ed25519_publickey(const ed25519_secret_key sk, ed25519_public_key pk);
  9. int ed25519_sign_open(const unsigned char *m, size_t mlen, const ed25519_public_key pk, const ed25519_signature RS);
  10. void ed25519_sign(const unsigned char *m, size_t mlen, const ed25519_secret_key sk, const ed25519_public_key pk, ed25519_signature RS);
  11. int ed25519_sign_open_batch(const unsigned char **m, size_t *mlen, const unsigned char **pk, const unsigned char **RS, size_t num, int *valid);
  12. void ed25519_randombytes_unsafe(void *out, size_t count);
  13. void curved25519_scalarmult_basepoint(curved25519_key pk, const curved25519_key e);
  14. #if defined(ED25519_SSE2)
  15. void ed25519_publickey_sse2(const ed25519_secret_key sk, ed25519_public_key pk);
  16. int ed25519_sign_open_sse2(const unsigned char *m, size_t mlen, const ed25519_public_key pk, const ed25519_signature RS);
  17. void ed25519_sign_sse2(const unsigned char *m, size_t mlen, const ed25519_secret_key sk, const ed25519_public_key pk, ed25519_signature RS);
  18. int ed25519_sign_open_batch_sse2(const unsigned char **m, size_t *mlen, const unsigned char **pk, const unsigned char **RS, size_t num, int *valid);
  19. void ed25519_randombytes_unsafe_sse2(void *out, size_t count);
  20. void curved25519_scalarmult_basepoint_sse2(curved25519_key pk, const curved25519_key e);
  21. #endif
  22. #endif // ED25519_H