ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
src/client/crypto.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <stdint.h>
16#include <stdbool.h>
17#include <stddef.h>
18
19#include "crypto/crypto.h"
20#include "platform/socket.h"
21
32int client_crypto_init(void);
33
46
54bool crypto_client_is_ready(void);
55
64
77int crypto_client_encrypt_packet(const uint8_t *plaintext, size_t plaintext_len, uint8_t *ciphertext,
78 size_t ciphertext_size, size_t *ciphertext_len);
79
92int crypto_client_decrypt_packet(const uint8_t *ciphertext, size_t ciphertext_len, uint8_t *plaintext,
93 size_t plaintext_size, size_t *plaintext_len);
94
100void crypto_client_cleanup(void);
101
110
119
129int crypto_client_process_rekey_request(const uint8_t *packet, size_t packet_len);
130
139
149int crypto_client_process_rekey_response(const uint8_t *packet, size_t packet_len);
150
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 crypto_client_initiate_rekey(void)
Initiate session rekeying (client-initiated)
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 client_crypto_handshake(socket_t socket)
Perform crypto handshake with server.
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
int socket_t
Socket handle type (POSIX: int)
Definition socket.h:50
Cross-platform socket interface for ascii-chat.
Cryptographic context structure.