cryptography rework and beginning of tcp-chat-protocol

This commit is contained in:
2025-10-31 23:19:08 +05:00
parent 42702ffbe7
commit a0bcd2560a
24 changed files with 682 additions and 283 deletions

View File

@@ -0,0 +1,10 @@
#include "v1.h"
Result(void) ClientHandshake_tryConstruct(ClientHandshake* ptr, Array(u8) session_key){
Deferral(1);
try_assert(session_key.size == AES_SESSION_KEY_SIZE);
PacketHeader_construct(&ptr->header, PROTOCOL_VERSION, PacketType_ClientHandshake, session_key.size);
memcpy(ptr->session_key, session_key.data, session_key.size);
Return RESULT_VOID;
}