aboutsummaryrefslogtreecommitdiffstats
path: root/tests/primitives/test_block.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/primitives/test_block.py')
-rw-r--r--tests/primitives/test_block.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/primitives/test_block.py b/tests/primitives/test_block.py
index f4d3f467..9f5905bf 100644
--- a/tests/primitives/test_block.py
+++ b/tests/primitives/test_block.py
@@ -63,3 +63,14 @@ class TestBlockCipher(object):
with pytest.raises(ValueError):
cipher.finalize()
+
+ def test_unaligned_block_encryption(self, api):
+ cipher = BlockCipher(
+ ciphers.AES(binascii.unhexlify(b"0" * 32)),
+ modes.ECB(),
+ api
+ )
+ ct = cipher.encrypt(b"a" * 15)
+ assert ct == b""
+ ct += cipher.encrypt(b"a" * 65)
+ assert len(ct) == 80