ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
src/client/crypto.h
Go to the documentation of this file.
1
49#pragma once
50
51#include <stdint.h>
52#include <stdbool.h>
53#include <stddef.h>
54
58
80
116int client_crypto_init(void);
117
161
169bool crypto_client_is_ready(void);
170
179
192int crypto_client_encrypt_packet(const uint8_t *plaintext, size_t plaintext_len, uint8_t *ciphertext,
193 size_t ciphertext_size, size_t *ciphertext_len);
194
207int crypto_client_decrypt_packet(const uint8_t *ciphertext, size_t ciphertext_len, uint8_t *plaintext,
208 size_t plaintext_size, size_t *plaintext_len);
209
215void crypto_client_cleanup(void);
216
225
234
244int crypto_client_process_rekey_request(const uint8_t *packet, size_t packet_len);
245
254
264int crypto_client_process_rekey_response(const uint8_t *packet, size_t packet_len);
265
const crypto_context_t * crypto_client_get_context(void)
Get crypto context for encryption/decryption.
bool crypto_client_should_rekey(void)
Check if session rekeying should be triggered.
void crypto_client_cleanup(void)
Cleanup crypto client resources.
int crypto_client_send_rekey_response(void)
Send REKEY_RESPONSE packet to server.
int client_crypto_handshake(acip_transport_t *transport)
Perform crypto handshake with server.
int crypto_client_initiate_rekey(void)
Initiate session rekeying (client-initiated)
void client_crypto_set_mode(uint8_t mode)
Set crypto mode for handshake (encryption + authentication)
int client_crypto_init(void)
Initialize client crypto handshake.
int crypto_client_encrypt_packet(const uint8_t *plaintext, size_t plaintext_len, uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_len)
Encrypt a packet for transmission.
int crypto_client_decrypt_packet(const uint8_t *ciphertext, size_t ciphertext_len, uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_len)
Decrypt a received packet.
bool crypto_client_is_ready(void)
Check if crypto handshake is ready.
int crypto_client_process_rekey_request(const uint8_t *packet, size_t packet_len)
Process received REKEY_REQUEST packet from server.
int crypto_client_process_rekey_response(const uint8_t *packet, size_t packet_len)
Process received REKEY_RESPONSE packet from server.
int crypto_client_send_rekey_complete(void)
Send REKEY_COMPLETE packet to server and commit to new key.
unsigned char uint8_t
Definition common.h:56
Cross-platform socket interface for ascii-chat.
ClangTool/LibTooling compatibility shim for stdbool.h.
Transport instance structure.
Definition transport.h:214
Cryptographic context structure.
Transport abstraction layer for ACIP protocol.