From dad564fa66dd0ab52058f25a0eaf6a8e5b3c4316 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sun, 17 Nov 2019 23:42:26 +0000 Subject: [PATCH] t/t-algorithms.py: Add a simple test for `Keccak1600.copy'. Organization: Straylight/Edgeware From: Mark Wooding --- t/t-algorithms.py | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- [mdw]