29 lines
1.0 KiB
C
29 lines
1.0 KiB
C
#ifndef ED25519_H
|
|
#define ED25519_H
|
|
|
|
// Nightcracker's Ed25519 - https://github.com/orlp/ed25519
|
|
|
|
#include <stddef.h>
|
|
#include "meshcore/packetstructs.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
void ed25519_create_keypair(unsigned char *public_key, unsigned char *private_key, const unsigned char *seed);
|
|
void ed25519_derive_pub(unsigned char *public_key, const unsigned char *private_key);
|
|
void ed25519_sign(unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key, const unsigned char *private_key);
|
|
void ed25519_sign_ad(FrameStruct *frame);
|
|
int ed25519_verify(const unsigned char *signature, const unsigned char *message, size_t message_len, const unsigned char *public_key);
|
|
int ed25519_verify_ad(const FrameStruct *frame);
|
|
void ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, const unsigned char *scalar);
|
|
void ed25519_key_exchange(unsigned char *shared_secret, const unsigned char *public_key, const unsigned char *private_key);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|