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/seal.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/seal.h')
| -rw-r--r-- | link/seal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/link/seal.h b/link/seal.h index 9245f25..de1e7a5 100644 --- a/link/seal.h +++ b/link/seal.h @@ -65,6 +65,13 @@ void pure_opener_free(PureOpener *); typedef struct PureAead PureAead; enum { PURE_AEAD_KEY = 16, PURE_AEAD_NONCE = 12, PURE_AEAD_TAG = 16 }; bool pure_link_secret(const PureSealKey *own, const unsigned char peer[PURE_SEAL_KEY], unsigned char out[32]); +/* An epoch's keys (link/link-protocol.h): a key pair made for once, raw (its + * holder clears the private half as soon as it has agreed: a link may hold + * one for long, and a node many, so they are not kept in the secure heap), + * and the secret it shares with another's public half (never all zeros). + * On a Raspberry Pi 5 the pair costs 57 µs and the secret 220. */ +bool pure_link_ephemeral(unsigned char private_key[32], unsigned char public_key[PURE_SEAL_KEY]); +bool pure_link_agree(const unsigned char private_key[32], const unsigned char peer[PURE_SEAL_KEY], unsigned char out[32]); bool pure_link_derive(const unsigned char secret[32], const unsigned char *info, size_t info_size, unsigned char *out, size_t out_size); PureAead *pure_aead(const unsigned char key[PURE_AEAD_KEY]); |
