From 19ebac6e3cd5e48e16a73c78342fa676dc905db9 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 29 Sep 2026 13:51:07 +0100 Subject: Let links make an X25519 pair for once, and agree with it An epoch's keys (docs/design/011-pure-transport.md): a pair made for the next epoch, held raw (a link may hold one for long and a node many, so not in OpenSSL's 16 KiB secure heap), and the secret its private half shares with the other side's public half, never all zeros. The crypto table's version is 5. --- link/crypto.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'link/crypto.c') diff --git a/link/crypto.c b/link/crypto.c index 2fa7d44..c8fb9bd 100644 --- a/link/crypto.c +++ b/link/crypto.c @@ -141,6 +141,16 @@ bool pure_link_secret(const PureSealKey *own, const unsigned char peer[PURE_SEAL return c && own && c->link_secret(own, peer, out); } +bool pure_link_ephemeral(unsigned char private_key[32], unsigned char public_key[PURE_SEAL_KEY]) { + const PureCrypto *c = loaded(NULL, 0); + return c && c->link_ephemeral(private_key, public_key); +} + +bool pure_link_agree(const unsigned char private_key[32], const unsigned char peer[PURE_SEAL_KEY], unsigned char out[32]) { + const PureCrypto *c = loaded(NULL, 0); + return c && c->link_agree(private_key, peer, out); +} + bool pure_link_derive(const unsigned char secret[32], const unsigned char *info, size_t info_size, unsigned char *out, size_t out_size) { const PureCrypto *c = loaded(NULL, 0); -- cgit v1.2.3