ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
include/ascii-chat/crypto/session.h
Go to the documentation of this file.
1#pragma once
3#include <libplatform/mutex.h>
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9#define CRYPTO_SESSION_MESSAGES 16
10
23
39
49 crypto_rekey_message_t, const void *,
50 size_t, uint64_t now_ns,
51 bool *consumed);
52
53#ifdef __cplusplus
54}
55#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
asciichat_error_t crypto_session_create(crypto_context_t *)
asciichat_error_t crypto_session_receive(crypto_session_t *, unsigned, unsigned, crypto_rekey_message_t, const void *, size_t, uint64_t now_ns, bool *consumed)
void crypto_session_unlock(crypto_session_t *)
struct crypto_session crypto_session_t
For crypto session, this is the live record that ties owner, mutex, records, rotation together....
asciichat_error_t crypto_session_lock(crypto_context_t *, crypto_session_t **)
asciichat_error_t crypto_session_tick(crypto_session_t *, uint64_t now_ns)
void crypto_session_destroy(crypto_context_t *)
#define CRYPTO_SESSION_MESSAGES
struct crypto_record crypto_record_t
When code needs to work with crypto record, it keeps crypto, key_epoch, last_receive_epoch,...
crypto_rekey_message_t
Definition rekey.h:10
#define CRYPTO_PUBLIC_KEY_SIZE
Public key size (X25519).
Definition sizes.h:72
Endpoint cryptographic state for handshake, packet protection, authentication, and rekeying.
crypto rekey session is intentionally a small, concrete record. Fields such as security,...
Definition rekey.h:29
uint8_t payload[CRYPTO_PUBLIC_KEY_SIZE]
For crypto session, this is the live record that ties owner, mutex, records, rotation together....
crypto_session_message_t messages[16]
crypto_rekey_session_t rotation