Include ed25519 and sha512 C language implementation.
[brdnet.git] / ed25519 / ed25519.h
blob8924659fa394e8d30d44f815ffd73b5a093ad700
1 #ifndef ED25519_H
2 #define ED25519_H
4 #include <stddef.h>
6 #if defined(_WIN32)
7 #if defined(ED25519_BUILD_DLL)
8 #define ED25519_DECLSPEC __declspec(dllexport)
9 #elif defined(ED25519_DLL)
10 #define ED25519_DECLSPEC __declspec(dllimport)
11 #else
12 #define ED25519_DECLSPEC
13 #endif
14 #else
15 #define ED25519_DECLSPEC
16 #endif
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
23 #ifndef ED25519_NO_SEED
24 int ED25519_DECLSPEC ed25519_create_seed(unsigned char *seed);
25 #endif
27 void ED25519_DECLSPEC ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed);
28 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);
29 int ED25519_DECLSPEC ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key);
30 void ED25519_DECLSPEC ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar);
31 void ED25519_DECLSPEC ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key);
34 #ifdef __cplusplus
36 #endif
38 #endif