ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
rekey.h
Go to the documentation of this file.
1#pragma once
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
19typedef asciichat_error_t (*crypto_rekey_emit_fn)(void *, unsigned,
21 const void *, size_t);
22
40
45 uint64_t now_ns);
47 uint64_t now_ns);
49 uint64_t now_ns);
51 unsigned, unsigned,
53 const void *, size_t,
54 uint64_t now_ns, bool *consumed);
56
57#ifdef __cplusplus
58}
59#endif
unsigned long long uint64_t
unsigned char uint8_t
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
struct crypto_record crypto_record_t
When code needs to work with crypto record, it keeps crypto, key_epoch, last_receive_epoch,...
asciichat_error_t(* crypto_rekey_emit_fn)(void *, unsigned, crypto_rekey_message_t, const void *, size_t)
Definition rekey.h:19
asciichat_error_t crypto_rekey_session_request(crypto_rekey_session_t *, uint64_t now_ns)
Definition rekey.c:140
asciichat_error_t crypto_rekey_session_init(crypto_rekey_session_t *, crypto_record_t *, crypto_rekey_emit_fn, void *, uint64_t now_ns)
Definition rekey.c:63
asciichat_error_t crypto_rekey_session_receive(crypto_rekey_session_t *, unsigned, unsigned, crypto_rekey_message_t, const void *, size_t, uint64_t now_ns, bool *consumed)
Definition rekey.c:150
void crypto_rekey_session_cleanup(crypto_rekey_session_t *)
Definition rekey.c:244
crypto_rekey_message_t
Definition rekey.h:10
@ CRYPTO_REKEY_REQUEST
Definition rekey.h:12
@ CRYPTO_REKEY_NONE
Definition rekey.h:11
@ CRYPTO_REKEY_RESPONSE
Definition rekey.h:13
@ CRYPTO_REKEY_MARKER
Definition rekey.h:15
@ CRYPTO_REKEY_NEEDED
Definition rekey.h:17
@ CRYPTO_REKEY_COMPLETE
Definition rekey.h:14
@ CRYPTO_REKEY_ACK
Definition rekey.h:16
asciichat_error_t crypto_rekey_session_tick(crypto_rekey_session_t *, uint64_t now_ns)
Definition rekey.c:87
#define CRYPTO_PUBLIC_KEY_SIZE
Public key size (X25519).
Definition sizes.h:72
crypto rekey session is intentionally a small, concrete record. Fields such as security,...
Definition rekey.h:29
uint8_t deferred_key[CRYPTO_PUBLIC_KEY_SIZE]
Definition rekey.h:35
uint64_t activated_ns
Definition rekey.h:33
crypto_record_t * security
Definition rekey.h:30
crypto_rekey_emit_fn send
Definition rekey.h:31
uint64_t seen_epoch
Definition rekey.h:33
uint64_t last_request_ns
Definition rekey.h:33
uint64_t peer_ack
Definition rekey.h:34
uint64_t exchange_ns
Definition rekey.h:33
⏱️ High-precision timing utilities using sokol_time.h and uthash