From: Mark Wooding Date: Sun, 17 Nov 2019 23:42:26 +0000 (+0000) Subject: t/t-algorithms.py: Add a simple test for `Keccak1600.copy'. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/dad564fa66dd0ab52058f25a0eaf6a8e5b3c4316 t/t-algorithms.py: Add a simple test for `Keccak1600.copy'. --- diff --git a/t/t-algorithms.py b/t/t-algorithms.py index fc6bff2..2fd0e09 100644 --- a/t/t-algorithms.py +++ b/t/t-algorithms.py @@ -742,6 +742,13 @@ class TestKeccak (HashBufferTestMixin): st1.mix(m0).step() me.assertNotEqual(st0.extract(32), st1.extract(32)) + ## Check state copying. + st1 = st0.copy() + mask = st1.extract(len(m1)) + st0.mix(m1) + st1.mix(m1) + me.assertEqual(st0.extract(32), st1.extract(32)) + ## Check error conditions. _ = st0.extract(200) me.assertRaises(ValueError, st0.extract, 201)