ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
prepare.h
Go to the documentation of this file.
1#pragma once
2
3#include <ascii-chat/buffer.h>
8#include <libplatform/socket.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
31
33asciichat_error_t acip_packet_plan(crypto_context_t *crypto, const socket_buffer_t *buffers, size_t count, acip_packet_plan_t *plan);
34
43asciichat_error_t acip_packet_encrypt(crypto_context_t *crypto, const acip_packet_plan_t *plan, buffer_domain_t *domain, void *ciphertext, size_t capacity, packet_header_t *header, size_t *length);
44
48
49asciichat_error_t acip_packet_decrypt_payload(crypto_record_t *, unsigned channel, unsigned delivery, const void *, size_t, uint8_t **, size_t *, uint64_t *);
50
51#ifdef __cplusplus
52}
53#endif
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 acip_packet_seal(crypto_record_t *, acip_traffic_class_t, acip_delivery_t, const void *, size_t, uint8_t **, size_t *)
Definition prepare.c:108
asciichat_error_t acip_packet_open_sequence(crypto_record_t *, acip_traffic_class_t, acip_delivery_t, const void *, size_t, uint8_t **, size_t *, uint64_t *)
Definition prepare.c:145
asciichat_error_t acip_packet_open(crypto_record_t *, acip_traffic_class_t, acip_delivery_t, const void *, size_t, uint8_t **, size_t *)
Definition prepare.c:160
asciichat_error_t acip_packet_plan(crypto_context_t *crypto, const socket_buffer_t *buffers, size_t count, acip_packet_plan_t *plan)
Definition prepare.c:9
asciichat_error_t acip_packet_encrypt(crypto_context_t *crypto, const acip_packet_plan_t *plan, buffer_domain_t *domain, void *ciphertext, size_t capacity, packet_header_t *header, size_t *length)
The useful part of acip packet plan is in buffers, count, plaintext_size, ciphertext_capacity: togeth...
Definition prepare.c:53
asciichat_error_t acip_packet_decrypt_payload(crypto_record_t *, unsigned channel, unsigned delivery, const void *, size_t, uint8_t **, size_t *, uint64_t *)
Definition prepare.c:164
struct crypto_record crypto_record_t
When code needs to work with crypto record, it keeps crypto, key_epoch, last_receive_epoch,...
size_t ciphertext_capacity
Definition prepare.h:24
crypto_record_t * records
Definition prepare.h:26
acip_send_options_t options
Definition prepare.h:28
const socket_buffer_t * buffers
Definition prepare.h:21
buffer_domain_t * domain
Borrowed control reserve for handshake/error traffic; NULL otherwise.
Definition prepare.h:29
size_t plaintext_size
Definition prepare.h:23
Endpoint cryptographic state for handshake, packet protection, authentication, and rekeying.
Fixed prefix shared by every ACIP packet on the wire.
Definition packet.h:641
acip_traffic_class_t
Definition traffic.h:9
acip_delivery_t
Definition traffic.h:15