4#ifndef PROTOCORE_ED25519_H
5#define PROTOCORE_ED25519_H
33#define PROTOCORE_ED25519_SEED_LEN 32
36#define PROTOCORE_ED25519_PUBKEY_LEN 32
39#define PROTOCORE_ED25519_SIG_LEN 64
44 embed_bool (*
pubkey)(uint8_t *,
const uint8_t *, uint8_t *);
45 embed_bool (*
sign)(uint8_t *,
const uint8_t *,
const uint8_t *, size_t, uint8_t *);
46 embed_bool (*
verify)(uint8_t *,
const uint8_t *,
const uint8_t *, size_t,
const uint8_t *);
67embed_bool
protocore_ed25519_sign(uint8_t *work,
const uint8_t *seed,
const uint8_t *msg,
size_t msg_len, uint8_t *sig);
embed_bool protocore_ed25519_pubkey(uint8_t *work, const uint8_t *seed, uint8_t *pub)
Derive the 32-byte public key A from the seed.
embed_bool protocore_ed25519_sign(uint8_t *work, const uint8_t *seed, const uint8_t *msg, size_t msg_len, uint8_t *sig)
Sign deterministically (RFC 8032 §5.1.6), writing R || S.
embed_bool protocore_ed25519_verify(uint8_t *work, const uint8_t *pub, const uint8_t *msg, size_t msg_len, const uint8_t *sig)
Check a signature (RFC 8032 §5.1.7); the answer is Ed25519Ns::ok.
#define PROTOCORE_UNUSED
Suppress the unused warning. Every module ends in a namespace most callers only partly use.
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
Dispatch table. Addressed by offset, so the layout is asserted below.
embed_bool(* sign)(uint8_t *, const uint8_t *, const uint8_t *, size_t, uint8_t *)
embed_bool(* verify)(uint8_t *, const uint8_t *, const uint8_t *, size_t, const uint8_t *)
embed_bool(* pubkey)(uint8_t *, const uint8_t *, uint8_t *)