ed25519.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef ED25519_H
  2. #define ED25519_H
  3. #include <stddef.h>
  4. #if defined(_WIN32)
  5. #if defined(ED25519_BUILD_DLL)
  6. #define ED25519_DECLSPEC __declspec(dllexport)
  7. #elif defined(ED25519_DLL)
  8. #define ED25519_DECLSPEC __declspec(dllimport)
  9. #else
  10. #define ED25519_DECLSPEC
  11. #endif
  12. #else
  13. #define ED25519_DECLSPEC
  14. #endif
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #ifndef ED25519_NO_SEED
  19. int ED25519_DECLSPEC ed25519_create_seed(unsigned char *seed);
  20. #endif
  21. void ED25519_DECLSPEC ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed);
  22. void ED25519_DECLSPEC ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key, const unsigned char *private_key);
  23. int ED25519_DECLSPEC ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key);
  24. void ED25519_DECLSPEC ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar);
  25. void ED25519_DECLSPEC ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key);
  26. #ifdef __cplusplus
  27. }
  28. #endif
  29. #endif