Files
zeekay 6322ce6797 fix: vendor sr25519-donna C files directly (no git submodule)
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.
2026-03-02 02:46:03 +00:00

35 lines
902 B
C

/*
a custom hash must have a 512bit digest and implement:
struct ed25519_hash_context;
void ed25519_hash_init(ed25519_hash_context *ctx);
void ed25519_hash_update(ed25519_hash_context *ctx, const uint8_t *in, size_t inlen);
void ed25519_hash_final(ed25519_hash_context *ctx, uint8_t *hash);
void ed25519_hash(uint8_t *hash, const uint8_t *in, size_t inlen);
*/
#include "sr25519-hash.h"
typedef sr25519_hash_context ed25519_hash_context;
static void
ed25519_hash_init(ed25519_hash_context *ctx) {
sr25519_hash_init(ctx);
}
static void
ed25519_hash_update(ed25519_hash_context *ctx, const uint8_t *in, size_t inlen) {
sr25519_hash_update(ctx, in, inlen);
}
static void
ed25519_hash_final(ed25519_hash_context *ctx, uint8_t *hash) {
sr25519_hash_final(ctx, hash);
}
static void
ed25519_hash(uint8_t *hash, const uint8_t *in, size_t inlen) {
sr25519_hash(hash, in, inlen);
}