added internal buffers to encrypted sockets
This commit is contained in:
@@ -176,13 +176,14 @@ void AESStreamDecryptor_construct(AESStreamDecryptor* ptr, Array(u8) key, const
|
||||
|
||||
Result(u32) AESStreamDecryptor_decrypt(AESStreamDecryptor* ptr, Array(u8) src, Array(u8) dst){
|
||||
Deferral(4);
|
||||
u32 decrypted_size = __AESStreamDecryptor_calcDstSize(src.size);
|
||||
try_assert(dst.size >= decrypted_size);
|
||||
|
||||
// if it is the beginning of the stream, read IV
|
||||
if(ptr->block_counter == 0){
|
||||
__Array_readNext(ptr->iv, &src, __AES_STREAM_IV_SIZE);
|
||||
}
|
||||
// size without IV
|
||||
u32 decrypted_size = src.size;
|
||||
try_assert(dst.size >= decrypted_size);
|
||||
|
||||
// decrypt full buffers
|
||||
while(src.size > __AES_BUFFER_SIZE){
|
||||
|
||||
Reference in New Issue
Block a user