aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2018-04-05 16:57:44 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2018-04-05 16:57:44 +0200
commit75248c00c275820b8499a8c938b4bf465be20812 (patch)
tree75e8cdf0ca7df96154a9813dedefdb5a567f4103 /src/model
parente0ce9f8797171aeff46176c7b3d6129ace9be30b (diff)
Adding message blocks for multi block tests.
Diffstat (limited to 'src/model')
-rwxr-xr-xsrc/model/python/sha512.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/model/python/sha512.py b/src/model/python/sha512.py
index 9e7cded..f25e6ae 100755
--- a/src/model/python/sha512.py
+++ b/src/model/python/sha512.py
@@ -295,6 +295,24 @@ def compare_digests(digest, expected):
print("Test case ok.")
+
+#-------------------------------------------------------------------
+# double_block_tests()
+#
+# NIST tests with dual block messages.
+#-------------------------------------------------------------------
+def double_block_tests():
+ TC_BLOCK1 = [0x6162636465666768, 0x6263646566676869, 0x636465666768696A, 0x6465666768696A6B,
+ 0x65666768696A6B6C, 0x666768696A6B6C6D, 0x6768696A6B6C6D6E, 0x68696A6B6C6D6E6F,
+ 0x696A6B6C6D6E6F70, 0x6A6B6C6D6E6F7071, 0x6B6C6D6E6F707172, 0x6C6D6E6F70717273,
+ 0x6D6E6F7071727374, 0x6E6F707172737475, 0x8000000000000000, 0x0000000000000000]
+
+ TC_BLOC2 = [0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
+ 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
+ 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
+ 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000380]
+
+
#-------------------------------------------------------------------
# single_block_tests()
#