diff options
| author | eunhhu <[email protected]> | 2026-09-29 13:51:07 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-29 13:51:07 +0100 |
| commit | 19ebac6e3cd5e48e16a73c78342fa676dc905db9 (patch) | |
| tree | ff1ca1db6aa594094e676a0bfd7a4b22ec6a0748 /link/crypto.h | |
| parent | f5ce5e2b6ff0f72cc506e464d0ebfad00bed3532 (diff) | |
| download | pure-19ebac6e3cd5e48e16a73c78342fa676dc905db9.tar.gz pure-19ebac6e3cd5e48e16a73c78342fa676dc905db9.zip | |
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.
Diffstat (limited to 'link/crypto.h')
| -rw-r--r-- | link/crypto.h | 4 |
1 files changed, 3 insertions, 1 deletions
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]); |
