diff options
| author | eunhhu <[email protected]> | 2026-09-29 07:22:19 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-29 07:22:19 +0100 |
| commit | 5dbf6a536627f9a29f7358c547426218aa6f23c1 (patch) | |
| tree | 3e92fc3358b83877d694a76ab8c264091df3af39 /link/link-protocol.h | |
| parent | 7c6595c8a9229a2208ed5bd75b2dee249187923d (diff) | |
| download | pure-5dbf6a536627f9a29f7358c547426218aa6f23c1.tar.gz pure-5dbf6a536627f9a29f7358c547426218aa6f23c1.zip | |
Make the load generator's devices real link senders, many on one thread
links.c was a second implementation of the packet format; each device is
now a PureLinkSender on a socket of its own, keyed with a secret made
outside (pure_link_sender_shared: a key kept elsewhere, or a test's
many). M1 (1k, 10k) and M2 (10k, kill -9) pass with it: no silent step,
caught up in 0.2 s, every order applied once; the slowest store after
the restart is now the sender's 1 s wait for a word of the save
(STORED_WAIT), where the old devices tried again after 200 ms.
Diffstat (limited to 'link/link-protocol.h')
| -rw-r--r-- | link/link-protocol.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/link/link-protocol.h b/link/link-protocol.h index b0f8ef3..3037926 100644 --- a/link/link-protocol.h +++ b/link/link-protocol.h @@ -67,14 +67,18 @@ typedef struct { /* ---- The sending side: one output's saved sends to a receiver's input, as * source (the receiver's name for it), their messages of shape (the * receiver's input must have the same: core/module.h's pure_module_shape), - * from own (this node's key, whose public half is own_public). NULL when - * the names are not 1 to PURE_LINK_NAME bytes, or memory runs out. */ + * from own (this node's key, whose public half is own_public; NULL when + * the secret comes from elsewhere). NULL when the names are not 1 to + * PURE_LINK_NAME bytes, or memory runs out. */ typedef struct PureLinkSender PureLinkSender; PureLinkSender *pure_link_sender(const char *source, const char *input, uint32_t shape, const PureSealKey *own, const unsigned char own_public[PURE_SEAL_KEY]); /* The receiver's public key: the keys made from it (one X25519). A sender * makes no packet before it has one. */ bool pure_link_sender_peer(PureLinkSender *, const unsigned char peer[PURE_SEAL_KEY]); +/* The same with the secret own's key shares with peer's made elsewhere (by + * a key kept in hardware, say, or a test's many keys): no X25519 here. */ +bool pure_link_sender_shared(PureLinkSender *, const unsigned char peer[PURE_SEAL_KEY], const unsigned char secret[32]); /* A saved send, numbered one past the last queued (any number when none * waits); false when it cannot be kept. */ bool pure_link_sender_queue(PureLinkSender *, uint64_t seq, const unsigned char *bytes, size_t size); |
