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 proto_bool (*pubkey)(uint8_t *,
const uint8_t *, uint8_t *);
45 proto_bool (*sign)(uint8_t *,
const uint8_t *,
const uint8_t *, size_t, uint8_t *);
46 proto_bool (*verify)(uint8_t *,
const uint8_t *,
const uint8_t *, size_t,
const uint8_t *);
proto_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.
PROTOCORE_NS Ed25519Ns Ed25519 PROTOCORE_UNUSED
Module namespace.
proto_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.
proto_bool protocore_ed25519_pubkey(uint8_t *work, const uint8_t *seed, uint8_t *pub)
Derive the 32-byte public key A from the seed.
#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.
proto_bool(* pubkey)(uint8_t *, const uint8_t *, uint8_t *)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS