mirror of
https://github.com/luxfi/precompile.git
synced 2026-10-30 14:45:41 +00:00
Git submodules don't work with Go module proxy — go get can't fetch the submodule contents. Vendored the src/ directory from TerenceGe/sr25519-donna directly into sr25519/donna/. Updated unity build paths (donna/src/ → donna/) and CGO CFLAGS. All 8 sr25519 tests pass.
31 lines
960 B
C
31 lines
960 B
C
#ifndef ED25519_H
|
|
#define ED25519_H
|
|
|
|
#include <stdlib.h>
|
|
|
|
#if defined(__cplusplus)
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef unsigned char ed25519_signature[64];
|
|
typedef unsigned char ed25519_public_key[32];
|
|
typedef unsigned char ed25519_secret_key[32];
|
|
|
|
typedef unsigned char curved25519_key[32];
|
|
|
|
void ed25519_publickey(const ed25519_secret_key sk, ed25519_public_key pk);
|
|
int ed25519_sign_open(const unsigned char *m, size_t mlen, const ed25519_public_key pk, const ed25519_signature RS);
|
|
void ed25519_sign(const unsigned char *m, size_t mlen, const ed25519_secret_key sk, const ed25519_public_key pk, ed25519_signature RS);
|
|
|
|
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);
|
|
|
|
void ed25519_randombytes_unsafe(void *out, size_t count);
|
|
|
|
void curved25519_scalarmult_basepoint(curved25519_key pk, const curved25519_key e);
|
|
|
|
#if defined(__cplusplus)
|
|
}
|
|
#endif
|
|
|
|
#endif // ED25519_H
|