aboutsummaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-02-04 17:58:51 +0100
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-02-04 17:58:51 +0100
commitd9e90335c5ba49c63f3e86acc72d401ac5138de9 (patch)
treeb1858d88ab64572001be9c61d20834881ccace32 /sw
parent39140593d239f5043a762334d8505af8c8de349b (diff)
Adding NIST test vectors for single and dual block sha256 tests. Adding function stubs for tests.
Diffstat (limited to 'sw')
-rw-r--r--sw/test-sha256/test-sha256.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/test-sha256/test-sha256.c b/sw/test-sha256/test-sha256.c
index 9b0fa1d..d87a902 100644
--- a/sw/test-sha256/test-sha256.c
+++ b/sw/test-sha256/test-sha256.c
@@ -65,6 +65,31 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
+void test_single_block()
+{
+ // Single block test vector as specified by NIST.
+ //tc0 = 512'h61626380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018;
+ //res0 = 256'hBA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD;
+
+
+}
+
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void test_dual_block()
+{
+ // Dual block test vectors as specified by NIST.
+ // tc1_0 = 512'h6162636462636465636465666465666765666768666768696768696A68696A6B696A6B6C6A6B6C6D6B6C6D6E6C6D6E6F6D6E6F706E6F70718000000000000000;
+ // res1_0 = 256'h85E655D6417A17953363376A624CDE5C76E09589CAC5F811CC4B32C1F20E533A;
+ // tc1_1 = 512'h000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001C0;
+ // res1_1 = 256'h248D6A61D20638B8E5C026930C3E6039A33CE45964FF2167F6ECEDD419DB06C1;
+
+
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
void test_sha256()
{
unsigned int write_addr;