diff options
author | lloyd <[email protected]> | 2007-03-04 05:23:52 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2007-03-04 05:23:52 +0000 |
commit | df1ad7ecc0d85c56acf7bba1271a2013b0f58e9b (patch) | |
tree | 4a7d928cfc5f58a56e20a0d8141750fd780304dd | |
parent | 5a752256eaf6b5516623739aad52100e3124fe51 (diff) |
Add startup selftests for SHA-256 and HMAC(SHA-256)
-rw-r--r-- | src/fips140.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/fips140.cpp b/src/fips140.cpp index 6adb03320..491510195 100644 --- a/src/fips140.cpp +++ b/src/fips140.cpp @@ -129,10 +129,28 @@ bool passes_self_tests() "68696A6B696A6B6C6A6B6C6D6B6C6D6E6C6D6E6F6D6E6F706E6F7071", "84983E441C3BD26EBAAE4AA1F95129E5E54670F1"); + hash_kat("SHA-256", "", + "E3B0C44298FC1C149AFBF4C8996FB924" + "27AE41E4649B934CA495991B7852B855"); + hash_kat("SHA-256", "616263", + "BA7816BF8F01CFEA414140DE5DAE2223" + "B00361A396177A9CB410FF61F20015AD"); + hash_kat("SHA-256", + "6162636462636465636465666465666765666768666768696768696A" + "68696A6B696A6B6C6A6B6C6D6B6C6D6E6C6D6E6F6D6E6F706E6F7071", + "248D6A61D20638B8E5C026930C3E6039" + "A33CE45964FF2167F6ECEDD419DB06C1"); + mac_kat("HMAC(SHA-1)", "4869205468657265", "B617318655057264E28BC0B6FB378C8EF146BE00", "0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B"); + mac_kat("HMAC(SHA-256)", "4869205468657265", + "198A607EB44BFBC69903A0F1CF2BBDC5" + "BA0AA3F3D9AE3C1C7A3B1696A0B68CF7", + "0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B" + "0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B0B"); + mac_kat("X9.19-MAC", "31311C3931383237333634351C1C35383134333237361C1C3B3132333435" "36373839303132333435363D3939313231303030303F1C30303031323530" |