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.c | |
| 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.c')
| -rw-r--r-- | link/crypto.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); |
