From 0809b51f844db7d8bf532ac7f1e8c7c7a6f89fd1 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 10 May 2017 20:53:27 +0100 Subject: [PATCH] symm/t/sha...: Add official NIST HMAC test vectors. I found some at last, annoyingly provided as PDF documents. Unsurprisingly, the code passed first time. Strange: the tests include two tests for the message `Sample message for keylen=blocklen', exactly one of which has the key length equal to the block length. Whatevs. --- symm/t/sha224 | 18 ++++++++++++++++-- symm/t/sha256 | 19 +++++++++++++++++-- symm/t/sha384 | 19 +++++++++++++++++-- symm/t/sha512 | 20 ++++++++++++++++++-- 4 files changed, 68 insertions(+), 8 deletions(-) diff --git a/symm/t/sha224 b/symm/t/sha224 index 8534f4f3..983e9c4e 100644 --- a/symm/t/sha224 +++ b/symm/t/sha224 @@ -1,10 +1,24 @@ # Test vectors for SHA-224 # --- HMAC mode --- -# -# Autogenerated, unofficial. sha224-hmac { + # NIST examples. + + "Sample message for keylen