From 75248c00c275820b8499a8c938b4bf465be20812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Thu, 5 Apr 2018 16:57:44 +0200 Subject: Adding message blocks for multi block tests. --- src/model/python/sha512.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/model/python') 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() # -- cgit v1.2.3