ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
src/server/crypto.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <stdint.h>
9#include <stdbool.h>
10#include <stddef.h>
11#include "crypto/crypto.h"
12#include "client.h"
13
14// Initialize server crypto handshake
15int server_crypto_init(void);
16
17// Perform crypto handshake with client
19
20// Check if crypto handshake is ready for a specific client
21bool crypto_server_is_ready(uint32_t client_id);
22
23// Get crypto context for encryption/decryption for a specific client
25
26// Encrypt a packet for transmission to a specific client
27int crypto_server_encrypt_packet(uint32_t client_id, const uint8_t *plaintext, size_t plaintext_len,
28 uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_len);
29
30// Decrypt a received packet from a specific client
31int crypto_server_decrypt_packet(uint32_t client_id, const uint8_t *ciphertext, size_t ciphertext_len,
32 uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_len);
33
34// Cleanup crypto resources for a specific client
unsigned int uint32_t
Definition common.h:58
unsigned char uint8_t
Definition common.h:56
Per-client state management and lifecycle orchestration.
int crypto_server_decrypt_packet(uint32_t client_id, const uint8_t *ciphertext, size_t ciphertext_len, uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_len)
int crypto_server_encrypt_packet(uint32_t client_id, const uint8_t *plaintext, size_t plaintext_len, uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_len)
const crypto_context_t * crypto_server_get_context(uint32_t client_id)
int server_crypto_init(void)
bool crypto_server_is_ready(uint32_t client_id)
void crypto_server_cleanup_client(uint32_t client_id)
int server_crypto_handshake(client_info_t *client)
Per-client state structure for server-side client management.
Cryptographic context structure.