From d9e90335c5ba49c63f3e86acc72d401ac5138de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Wed, 4 Feb 2015 17:58:51 +0100 Subject: Adding NIST test vectors for single and dual block sha256 tests. Adding function stubs for tests. --- sw/test-sha256/test-sha256.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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 @@ -63,6 +63,31 @@ #define ADDR_DIGEST7 (SHA256_BASE + (0x27 << 2)) +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +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() -- cgit v1.2.3