ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
record.h
Go to the documentation of this file.
1#pragma once
3#include <ascii-chat/buffer.h>
5#include <limits.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define CRYPTO_RECORD_CHANNELS 3
12#define CRYPTO_RECORD_CONTROL_CHANNEL 0
13#define CRYPTO_RECORD_RELIABLE 0
14#define CRYPTO_RECORD_DATAGRAM 1
15#define CRYPTO_RECORD_ANY_CHANNEL UINT_MAX
16
39
40typedef asciichat_error_t (*crypto_record_validate_fn)(void *, unsigned,
41 unsigned, const void *,
42 size_t);
44 bool server);
48 unsigned delivery, const void *,
49 size_t, uint8_t *, size_t, size_t *);
52 unsigned delivery, const void *, size_t,
53 uint8_t *, size_t, size_t *, buffer_domain_t *);
56 unsigned delivery, const void *, size_t, uint8_t **,
58 void *);
62 unsigned channel,
63 uint64_t epoch);
65
66#ifdef __cplusplus
67}
68#endif
Synchronized per-thread pending error stacks and value snapshots. SET_ERRNO pushes,...
struct buffer_domain buffer_domain_t
Definition buffer.h:28
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
asciichat_error_t(* crypto_record_validate_fn)(void *, unsigned, unsigned, const void *, size_t)
Definition record.h:40
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_record_seal_into(crypto_record_t *, unsigned channel, unsigned delivery, const void *, size_t, uint8_t *, size_t, size_t *)
Definition record.c:39
void crypto_record_cleanup(crypto_record_t *)
Definition record.c:293
asciichat_error_t crypto_record_commit_epoch(crypto_record_t *)
Definition record.c:251
asciichat_error_t crypto_record_open_sequence(crypto_record_t *, unsigned channel, unsigned delivery, const void *, size_t, uint8_t **, size_t *, uint64_t *, crypto_record_validate_fn, void *)
Definition record.c:107
asciichat_error_t crypto_record_retire_epoch_flow(crypto_record_t *, unsigned channel, uint64_t epoch)
Definition record.c:277
asciichat_error_t crypto_record_prepare_epoch(crypto_record_t *)
Definition record.c:241
asciichat_error_t crypto_record_init(crypto_record_t *, crypto_context_t *, bool server)
Definition record.c:26
#define CRYPTO_RECORD_CHANNELS
Definition record.h:11
asciichat_error_t crypto_record_seal_into_domain(crypto_record_t *, unsigned channel, unsigned delivery, const void *, size_t, uint8_t *, size_t, size_t *, buffer_domain_t *)
Definition record.c:49
Endpoint cryptographic state for handshake, packet protection, authentication, and rekeying.
When code needs to work with crypto record, it keeps crypto, key_epoch, last_receive_epoch,...
Definition record.h:26
uint64_t last_receive_epoch
Definition record.h:28
unsigned last_receive_delivery
Definition record.h:36
bool previous_valid
Definition record.h:31
crypto_context_t previous_crypto
Definition record.h:29
uint64_t datagram_seen[3]
Definition record.h:35
bool pending_prepared
Definition record.h:31
uint64_t receive_high[3][2]
Definition record.h:34
crypto_context_t * crypto
Definition record.h:27
uint64_t key_epoch
Definition record.h:28
uint64_t send_sequence[3][2]
Definition record.h:33
bool server
Definition record.h:37
bool previous_allowed[3]
Definition record.h:32
unsigned last_receive_channel
Definition record.h:36
uint64_t previous_epoch
Definition record.h:30