chiark
/
gitweb
/
~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t/t-algorithms.py: Add a simple test for `Keccak1600.copy'.
[catacomb-python]
/
t
/
t-algorithms.py
diff --git
a/t/t-algorithms.py
b/t/t-algorithms.py
index fc6bff2e83d29bbfb7b71d1bb62c1bbddf415147..2fd0e090656c26783047ff76be19b85ee1d90445 100644
(file)
--- 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))
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)
## Check error conditions.
_ = st0.extract(200)
me.assertRaises(ValueError, st0.extract, 201)