]> Cypherpunks.ru repositories - pygost.git/blobdiff - pygost/test_gost28147.py
28147-89 CBC key meshing ability
[pygost.git] / pygost / test_gost28147.py
index f28618d2c8bbd086a61789c2a2d23ab14ce64675..037b7b86ff643502eccc928774c3eafae6665645 100644 (file)
@@ -338,6 +338,13 @@ class CBCTest(TestCase):
         iv = urandom(8)
         cbc_decrypt(key, cbc_encrypt(key, 8 * b"x", iv))
 
+    def test_meshing(self):
+        pt = urandom(MESH_MAX_DATA * 3)
+        key = urandom(32)
+        ct = cbc_encrypt(key, pt)
+        dt = cbc_decrypt(key, ct)
+        self.assertEqual(pt, dt)
+
 
 class CFBMeshingTest(TestCase):
     def setUp(self):