ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
rekey.h
Go to the documentation of this file.
1#pragma once
4
15typedef asciichat_error_t (*crypto_rekey_emit_fn)(void *, unsigned, crypto_rekey_message_t, const void *, size_t);
16
29
32 uint64_t now_ns);
36 const void *, size_t, uint64_t now_ns, bool *consumed);
unsigned long long uint64_t
Definition common.h:63
unsigned char uint8_t
Definition common.h:60
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:44
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:15
asciichat_error_t crypto_rekey_session_request(crypto_rekey_session_t *, uint64_t now_ns)
Definition rekey.c:118
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:53
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:127
void crypto_rekey_session_cleanup(crypto_rekey_session_t *)
Definition rekey.c:203
crypto_rekey_message_t
Definition rekey.h:6
@ CRYPTO_REKEY_REQUEST
Definition rekey.h:8
@ CRYPTO_REKEY_NONE
Definition rekey.h:7
@ CRYPTO_REKEY_RESPONSE
Definition rekey.h:9
@ CRYPTO_REKEY_MARKER
Definition rekey.h:11
@ CRYPTO_REKEY_NEEDED
Definition rekey.h:13
@ CRYPTO_REKEY_COMPLETE
Definition rekey.h:10
@ CRYPTO_REKEY_ACK
Definition rekey.h:12
asciichat_error_t crypto_rekey_session_tick(crypto_rekey_session_t *, uint64_t now_ns)
Definition rekey.c:72
#define CRYPTO_PUBLIC_KEY_SIZE
Public key size (X25519).
Definition sizes.h:67
crypto rekey session is intentionally a small, concrete record. Fields such as security,...
Definition rekey.h:20
uint8_t deferred_key[CRYPTO_PUBLIC_KEY_SIZE]
Definition rekey.h:25
uint64_t activated_ns
Definition rekey.h:24
crypto_record_t * security
Definition rekey.h:21
crypto_rekey_emit_fn send
Definition rekey.h:22
uint64_t seen_epoch
Definition rekey.h:24
uint64_t last_request_ns
Definition rekey.h:24
uint64_t peer_ack
Definition rekey.h:24
uint64_t exchange_ns
Definition rekey.h:24
⏱️ High-precision timing utilities using sokol_time.h and uthash