Open
Description
Describe the bug
Incorrect auth tag generated for GCM mode when feeding data using small chunks (at least when sized to cipher's block size). Using such small chunks appear to conform with DEC's documentation.
To Reproduce
- Apply commit af94b8b on top of latest master
- Add new test case to test chunked stream encoding, which uses existing test data set but feeds data in a smaller chunks (cipher's blocks sized) instead of whole stream at once
procedure TestTDECGCM.TestEncodeStreamChunked;
begin
// Use cipher block size as max chunk size
DoTestEncodeStream_LoadAndTestCAVSData(
Max(FCipherAES.Context.BlockSize, FCipherAES.Context.BufferSize));
end;
- Run test GCM suite and get auth tag failure in new test case
Expected and actual behavior
Test should pass, proving that expected auth tag is generated when streaming data in small chunks.