diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | testsuite/sha512-test.c | 48 |
2 files changed, 53 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2013-03-14 Niels Möller <nisse@lysator.liu.se> + + * testsuite/sha512-test.c (test_main): Additional test vectors, + including some longer than 128 bytes. + 2013-03-13 Niels Möller <nisse@lysator.liu.se> * armv7/sha512-compress.asm: New file, using neon instructions. diff --git a/testsuite/sha512-test.c b/testsuite/sha512-test.c index f1c36d39..a8c7b188 100644 --- a/testsuite/sha512-test.c +++ b/testsuite/sha512-test.c @@ -19,6 +19,54 @@ test_main(void) "501d289e4900f7e4 331b99dec4b5433a" "c7d329eeb6dd2654 5e96e55b874be909")); + /* NESSIE, Set 1, vector #6 */ + test_hash(&nettle_sha512, + SDATA("ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789"), + SHEX("1E07BE23C26A86EA37EA810C8EC78093" + "52515A970E9253C26F536CFC7A9996C4" + "5C8370583E0A78FA4A90041D71A4CEAB" + "7423F19C71B9D5A3E01249F0BEBD5894")); + + /* NESSIE, Set 1, vector #7 */ + test_hash(&nettle_sha512, + SDATA("1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890"), + SHEX("72EC1EF1124A45B047E8B7C75A932195" + "135BB61DE24EC0D1914042246E0AEC3A" + "2354E093D76F3048B456764346900CB1" + "30D2A4FD5DD16ABB5E30BCB850DEE843")); + + /* Variants longer than one block (128 bytes), to test varying alignment. */ + test_hash(&nettle_sha512, + SDATA("ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789"), + SHEX("5338370f5655f4da14572d4fb471539b" + "201485ecfb3d3204048dc6b83e61fab5" + "05bcbbd73e644a1a5d159a32a0889cf3" + "c9591b69b26d31be56c68838ce3cd63d")); + test_hash(&nettle_sha512, + SDATA("1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890") , + SHEX("33f8901b053e4cc677d3cb4122d96ad9" + "b96b13bf76194cf962488bb4de4998a7" + "1455cb31582db527adf77a485b81cf5b" + "722a5e8638eb6be487400f3aec006e7c")); + /* Additional test vectors, from Daniel Kahn Gillmor */ test_hash(&nettle_sha512, SDATA(""), SHEX("cf83e1357eefb8bd f1542850d66d8007" |