added internal buffers to encrypted sockets

This commit is contained in:
2025-11-06 22:27:41 +05:00
parent 375dd842d4
commit d36fe9e5b3
10 changed files with 233 additions and 126 deletions

View File

@@ -89,7 +89,7 @@ typedef struct AESStreamEncryptor {
void AESStreamEncryptor_construct(AESStreamEncryptor* ptr, Array(u8) key, const br_block_ctr_class* ctr_class);
/// use this only at the beginning of the stream
#define AESStreamEncryptor_calcDstSize(src_size) (src_size + __AES_BLOCK_IV_SIZE)
#define AESStreamEncryptor_calcDstSize(src_size) (src_size + __AES_STREAM_IV_SIZE)
/// @brief If ptr->block_counter == 0, writes random IV to `dst`. After that writes encrypted data to dst.
/// @param src array of any size
@@ -119,5 +119,3 @@ void AESStreamDecryptor_construct(AESStreamDecryptor* ptr, Array(u8) key, const
/// @param dst array of size >= src.size
/// @return size of decrypted data
Result(u32) AESStreamDecryptor_decrypt(AESStreamDecryptor* ptr, Array(u8) src, Array(u8) dst);
#define __AESStreamDecryptor_calcDstSize(src_size) (src_size - __AES_BLOCK_IV_SIZE)