2014-07-12 08:20:16 +02:00
|
|
|
#ifndef ED25519_HPP
|
|
|
|
#define ED25519_HPP
|
2013-08-18 18:01:20 +02:00
|
|
|
|
2018-05-13 21:59:50 +02:00
|
|
|
#include "libtorrent/aux_/export.hpp" // for TORRENT_EXPORT
|
2014-08-16 09:46:06 +02:00
|
|
|
#include <stddef.h> // for size_t
|
2013-08-18 18:01:20 +02:00
|
|
|
|
2017-04-12 19:00:57 +02:00
|
|
|
namespace libtorrent {
|
|
|
|
|
2014-05-12 09:28:34 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ed25519_seed_size = 32,
|
|
|
|
ed25519_private_key_size = 64,
|
|
|
|
ed25519_public_key_size = 32,
|
|
|
|
ed25519_signature_size = 64,
|
|
|
|
ed25519_scalar_size = 32,
|
2014-07-05 01:40:31 +02:00
|
|
|
ed25519_shared_secret_size = 32
|
2014-05-12 09:28:34 +02:00
|
|
|
};
|
|
|
|
|
2016-08-30 02:28:42 +02:00
|
|
|
void TORRENT_EXTRA_EXPORT ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed);
|
|
|
|
void TORRENT_EXTRA_EXPORT ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key, const unsigned char *private_key);
|
|
|
|
int TORRENT_EXTRA_EXPORT ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key);
|
|
|
|
void TORRENT_EXTRA_EXPORT ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar);
|
|
|
|
void TORRENT_EXTRA_EXPORT ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key);
|
2013-08-18 18:01:20 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-07-12 08:20:16 +02:00
|
|
|
#endif // ED25519_HPP
|