diff options
author | Fergus Dall <sidereal@google.com> | 2023-06-12 20:02:14 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2023-06-28 08:00:43 +1000 |
commit | 81bafac5cbbd195ff9c53a06aaca7c3eacbb2fc0 (patch) | |
tree | c08c6dc6997d7f719830609d190275d6b6ceba7d /test | |
parent | 8b7d5ea7dd602eb7c2c4bc5ad45489dc5fc711f6 (diff) |
Add support for SHA256/192
This is defined in NIST SP 800-208 as the truncation to 192 bits of
SHA256. Unlike other truncated hashes in the SHA2 suite, this variant
doesn't have a different initial state, it is just a pure truncation
of the output.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21180)
Diffstat (limited to 'test')
-rw-r--r-- | test/recipes/30-test_evp_data/evpmac_common.txt | 23 | ||||
-rw-r--r-- | test/recipes/30-test_evp_data/evpmd_sha.txt | 19 |
2 files changed, 42 insertions, 0 deletions
diff --git a/test/recipes/30-test_evp_data/evpmac_common.txt b/test/recipes/30-test_evp_data/evpmac_common.txt index d9c8a15c01..7bcce7d920 100644 --- a/test/recipes/30-test_evp_data/evpmac_common.txt +++ b/test/recipes/30-test_evp_data/evpmac_common.txt @@ -67,6 +67,29 @@ BlockSize = 64 Title = SHA2 +Availablein = default +MAC = HMAC +Algorithm = SHA256-192 +Input = "Sample message for keylen=blocklen" +Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F +Output = 48C07F4015447032622F0F1F368EBB02EE1424F3529739D6 +OutputSize = 24 +BlockSize = 64 + +Availablein = default +MAC = HMAC +Algorithm = SHA256-192 +Input = "Sample message for keylen<blocklen" +Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B +Output = 6ECCAB0BE3F7657CAF65CAD9784C8177C9F83A685AB52F4C + +Availablein = default +MAC = HMAC +Algorithm = SHA256-192 +Input = "Sample message for keylen=blocklen" +Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60616263 +Output = 4FC15185394271A626627835B912A9CF641C9CD84F7909A4 + MAC = HMAC Algorithm = SHA224 Input = "Sample message for keylen=blocklen" diff --git a/test/recipes/30-test_evp_data/evpmd_sha.txt b/test/recipes/30-test_evp_data/evpmd_sha.txt index 1b417bfca7..149137b712 100644 --- a/test/recipes/30-test_evp_data/evpmd_sha.txt +++ b/test/recipes/30-test_evp_data/evpmd_sha.txt @@ -58,6 +58,25 @@ Input = "a" Ncopy = 64 Output = cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0 +Availablein = default +Digest = SHA256-192 +Input = "abc" +Output = ba7816bf8f01cfea414140de5dae2223b00361a396177a9c + +Availablein = default +Digest = SHA256-192 +Input = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" +Output = 248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167 + +Availablein = default +Digest = SHA256-192 +Input = "a" +Ncopy = 288 +Count = 3472 +Input = "a" +Ncopy = 64 +Output = cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e + Digest = SHA384 Input = "abc" Output = cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7 |