On Fri May 30 20:14:13 2025 +0000, Charlotte Pabst wrote:
Where should the test be instead? I added it here since it's very similar to the existing ones. FYI The main work is done by test_byte_stream, the additional test is basically just for verifying that the behavior applies to a big file (bigger than the chunk size constant), too. The game I'm dealing with uses CBC encryption for a video file, and creates a new decryption context for each byte stream read. If reads are misaligned or too large, some blocks will get XORed with the initialization vector instead of the previous block, or vice versa. This is obviously very messy on the game's side. Maybe this patch should just be on proton instead, I don't know - but the behavior is consistent on windows, so I thought upstream could benefit from it.
For me it would be enough to have a test program attached to this MR instead, existing tests are hard to read already. Some code and commit comments in sources implementation should be enough for such change in my opinion.
Regardless, you don't really need test files of specific size, it should be possible to memset() output instead, using WAV format for example, or prepare it in memory.