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.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'link/crypto.h') diff --git a/link/crypto.h b/link/crypto.h index 53ac785..ede5fb9 100644 --- a/link/crypto.h +++ b/link/crypto.h @@ -8,7 +8,7 @@ * first time a server seals, opens a seal or connects to an https receiver * (link/crypto.c): one that does none of these maps no OpenSSL, 2.3 MiB * less resident and 0.6 MiB less of its own. */ -enum { PURE_CRYPTO_VERSION = 4 }; +enum { PURE_CRYPTO_VERSION = 5 }; typedef struct { unsigned version; @@ -35,6 +35,8 @@ typedef struct { void (*opener_free)(PureOpener *); /* Links, as link/seal.h says. */ bool (*link_secret)(const PureSealKey *, const unsigned char peer[PURE_SEAL_KEY], unsigned char out[32]); + bool (*link_ephemeral)(unsigned char private_key[32], unsigned char public_key[PURE_SEAL_KEY]); + bool (*link_agree)(const unsigned char private_key[32], const unsigned char peer[PURE_SEAL_KEY], unsigned char out[32]); bool (*link_derive)(const unsigned char secret[32], const unsigned char *info, size_t info_size, unsigned char *out, size_t out_size); PureAead *(*aead)(const unsigned char key[PURE_AEAD_KEY]); -- cgit v1.2.3