ascii-chat 0.11.33
Video chat in your terminal
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>
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(const char *client_id);
22
23// Get crypto context for encryption/decryption for a specific client
24const crypto_context_t *crypto_server_get_context(const char *client_id);
25
26// Encrypt a packet for transmission to a specific client
27int crypto_server_encrypt_packet(const char *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(const char *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
35void crypto_server_cleanup_client(const char *client_id);
unsigned char uint8_t
Definition common.h:56
bool crypto_server_is_ready(const char *client_id)
int crypto_server_decrypt_packet(const char *client_id, const uint8_t *ciphertext, size_t ciphertext_len, uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_len)
void crypto_server_cleanup_client(const char *client_id)
const crypto_context_t * crypto_server_get_context(const char *client_id)
int crypto_server_encrypt_packet(const char *client_id, const uint8_t *plaintext, size_t plaintext_len, uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_len)
int server_crypto_init(void)
int server_crypto_handshake(client_info_t *client)
Client-side H.265 media capture and encoding pipeline.
ClangTool/LibTooling compatibility shim for stdbool.h.
Per-client state structure for server-side client management.
Cryptographic context structure.