From 7c8d36c8c55820f6bd39ed54152c1d7355f5f291 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 11 Jan 2024 17:44:14 -1000 Subject: [PATCH] chore: add more coverage (#9) --- tests/test_init.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_init.py b/tests/test_init.py index d2fde0e..f4997ff 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -199,3 +199,13 @@ def test_encrypt_with_nulls(): == b"\x00\x00\x00\x0e\xdf\xb7\xde\xad\xad\xc5\xa4\xd7\xd7\xb9\xcc\xa0\xcc\xbf" ) assert decrypt(encrypt(string_with_nulls)[4:]) == string_with_nulls + + +def test_encrypt_round_decreasing_size(): + for i in range(0, 128): + payload = bytes([i] * i).decode() + assert decrypt(encrypt(payload)[4:]) == payload + + for i in range(127, 0, -1): + payload = bytes([i] * i).decode() + assert decrypt(encrypt(payload)[4:]) == payload