aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-05-31 23:40:17 -0400
committerRob Austein <sra@hactrn.net>2016-05-31 23:40:17 -0400
commit00f3181d2411068353efd6a5aadb3e70f064db2a (patch)
treed718597a46fc3484eb41f7222b48a48243edcf84 /tests
parentc51fa2770ba45837cf3af8576c813b7934cb709f (diff)
SHA-224 driver and soft core.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-hash.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test-hash.c b/tests/test-hash.c
index e8c6a01..65ddf15 100644
--- a/tests/test-hash.c
+++ b/tests/test-hash.c
@@ -53,6 +53,12 @@ static const uint8_t sha1_single_digest[] = { /* 20 bytes */
0x78, 0x50, 0xc2, 0x6c, 0x9c, 0xd0, 0xd8, 0x9d
};
+static const uint8_t sha224_single_digest[] = { /* 28 bytes */
+ 0x23, 0x09, 0x7d, 0x22, 0x34, 0x05, 0xd8, 0x22, 0x86, 0x42, 0xa4, 0x77,
+ 0xbd, 0xa2, 0x55, 0xb3, 0x2a, 0xad, 0xbc, 0xe4, 0xbd, 0xa0, 0xb3, 0xf7,
+ 0xe3, 0x6c, 0x9d, 0xa7
+};
+
static const uint8_t sha256_single_digest[] = { /* 32 bytes */
0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea, 0x41, 0x41, 0x40, 0xde,
0x5d, 0xae, 0x22, 0x23, 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
@@ -73,6 +79,12 @@ static const uint8_t sha1_double_digest[] = { /* 20 bytes */
0xf9, 0x51, 0x29, 0xe5, 0xe5, 0x46, 0x70, 0xf1
};
+static const uint8_t sha224_double_digest[] = { /* 28 bytes */
+ 0x75, 0x38, 0x8b, 0x16, 0x51, 0x27, 0x76, 0xcc, 0x5d, 0xba, 0x5d, 0xa1,
+ 0xfd, 0x89, 0x01, 0x50, 0xb0, 0xc6, 0x45, 0x5c, 0xb4, 0xf5, 0x8b, 0x19,
+ 0x52, 0x52, 0x25, 0x25
+};
+
static const uint8_t sha256_double_digest[] = { /* 32 bytes */
0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8, 0xe5, 0xc0, 0x26, 0x93,
0x0c, 0x3e, 0x60, 0x39, 0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
@@ -655,6 +667,9 @@ int main (int argc, char *argv[])
ok &= test_hash(sha1_core, hal_hash_sha1, nist_512_single, sha1_single_digest, "SHA-1 single block");
ok &= test_hash(sha1_core, hal_hash_sha1, nist_512_double, sha1_double_digest, "SHA-1 double block");
+ ok &= test_hash(sha256_core, hal_hash_sha224, nist_512_single, sha224_single_digest, "SHA-224 single block");
+ ok &= test_hash(sha256_core, hal_hash_sha224, nist_512_double, sha224_double_digest, "SHA-224 double block");
+
ok &= test_hash(sha256_core, hal_hash_sha256, nist_512_single, sha256_single_digest, "SHA-256 single block");
ok &= test_hash(sha256_core, hal_hash_sha256, nist_512_double, sha256_double_digest, "SHA-256 double block");