From 68ced287f00906c68bb847a166b9da68a80458f6 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 1 Oct 2013 21:26:48 -0500 Subject: add ISO/IEC 10118-3 test vectors for RIPEMD160 and Whirlpool. These vectors have been reformatted from their original form to conform to the same format as the NIST SHA tests. * RIPEMD160 original vectors from the hash homepage - http://homes.esat.kuleuven.be/~bosselae/ripemd160.html * Whirlpool vectors from the hash homepage - http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html (yes that really is the homepage) --- .../vectors/ISO/whirlpool/iso-test-vectors-raw.txt | 73 ++++++++++++++++++++++ .../vectors/ISO/whirlpool/iso-test-vectors.txt | 71 +++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100755 tests/primitives/vectors/ISO/whirlpool/iso-test-vectors-raw.txt create mode 100755 tests/primitives/vectors/ISO/whirlpool/iso-test-vectors.txt (limited to 'tests/primitives/vectors/ISO/whirlpool') diff --git a/tests/primitives/vectors/ISO/whirlpool/iso-test-vectors-raw.txt b/tests/primitives/vectors/ISO/whirlpool/iso-test-vectors-raw.txt new file mode 100755 index 00000000..cab7a135 --- /dev/null +++ b/tests/primitives/vectors/ISO/whirlpool/iso-test-vectors-raw.txt @@ -0,0 +1,73 @@ +1. In this example the data-string is the empty string, i.e. the string of length zero. + +The hash-code is the following 512-bit string. + + + 19FA61D75522A466 9B44E39C1D2E1726 C530232130D407F8 9AFEE0964997F7A7 + 3E83BE698B288FEB CF88E3E03C4F0757 EA8964E59B63D937 08B138CC42A66EB3 + +2. In this example the data-string consists of a single byte, namely the ASCII-coded version of the letter 'a'. + +The hash-code is the following 512-bit string. + + + 8ACA2602792AEC6F 11A67206531FB7D7 F0DFF59413145E69 73C45001D0087B42 + D11BC645413AEFF6 3A42391A39145A59 1A92200D560195E5 3B478584FDAE231A + +3. In this example the data-string is the three-byte string consisting of the ASCII-coded version of 'abc'. + +The hash-code is the following 512-bit string. + + + 4E2448A4C6F486BB 16B6562C73B4020B F3043E3A731BCE72 1AE1B303D97E6D4C + 7181EEBDB6C57E27 7D0E34957114CBD6 C797FC9D95D8B582 D225292076D4EEF5 + +4. In this example the data-string is the 14-byte string consisting of the ASCII-coded version of 'message digest'. + +The hash-code is the following 512-bit string. + + + 378C84A4126E2DC6 E56DCC7458377AAC 838D00032230F53C E1F5700C0FFB4D3B + 8421557659EF55C1 06B4B52AC5A4AAA6 92ED920052838F33 62E86DBD37A8903E + +5. In this example the data-string is the 26-byte string consisting of the ASCII-coded version of 'abcdefghijklmnopqrstuvwxyz'. + +The hash-code is the following 512-bit string. + + + F1D754662636FFE9 2C82EBB9212A484A 8D38631EAD4238F5 442EE13B8054E41B + 08BF2A9251C30B6A 0B8AAE86177AB4A6 F68F673E7207865D 5D9819A3DBA4EB3B + +6. In this example the data-string is the 62-byte string consisting of the ASCII-coded version of 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'. + +The hash-code is the following 512-bit string. + + + DC37E008CF9EE69B F11F00ED9ABA2690 1DD7C28CDEC066CC 6AF42E40F82F3A1E + 08EBA26629129D8F B7CB57211B9281A6 5517CC879D7B9621 42C65F5A7AF01467 + +7. In this example the data-string is the 80-byte string consisting of the ASCII-coded version of eight repetitions of '1234567890'. + +The hash-code is the following 512-bit string. + + + 466EF18BABB0154D 25B9D38A6414F5C0 8784372BCCB204D6 549C4AFADB601429 + 4D5BD8DF2A6C44E5 38CD047B2681A51A 2C60481E88C5A20B 2C2A80CF3A9A083B + +8. In this example the data-string is the 32-byte string consisting of the ASCII-coded version of 'abcdbcdecdefdefgefghfghighijhijk'. + +The hash-code is the following 512-bit string. + + + 2A987EA40F917061 F5D6F0A0E4644F48 8A7A5A52DEEE6562 07C562F988E95C69 + 16BDC8031BC5BE1B 7B947639FE050B56 939BAAA0ADFF9AE6 745B7B181C3BE3FD + +9. In this example the data-string is the 1000000-byte string consisting of the ASCII-coded version of 'a' repeated 10^6 times. + +The hash-code is the following 512-bit string. + + + 0C99005BEB57EFF5 0A7CF005560DDF5D 29057FD86B20BFD6 2DECA0F1CCEA4AF5 + 1FC15490EDDC47AF 32BB2B66C34FF9AD 8C6008AD677F7712 6953B226E4ED8B01 + + diff --git a/tests/primitives/vectors/ISO/whirlpool/iso-test-vectors.txt b/tests/primitives/vectors/ISO/whirlpool/iso-test-vectors.txt new file mode 100755 index 00000000..08044c0b --- /dev/null +++ b/tests/primitives/vectors/ISO/whirlpool/iso-test-vectors.txt @@ -0,0 +1,71 @@ +# These vectors have been reformatted to load via the hash loader +# 1. In this example the data-string is the empty string, i.e. the string of length zero. + +# The hash-code is the following 512-bit string. + +Len = 0 +Msg = 00 +MD = 19FA61D75522A466 9B44E39C1D2E1726 C530232130D407F8 9AFEE0964997F7A7 3E83BE698B288FEB CF88E3E03C4F0757 EA8964E59B63D937 08B138CC42A66EB3 + +# 2. In this example the data-string consists of a single byte, namely the ASCII-coded version of the letter 'a'. + +# The hash-code is the following 512-bit string. + +Len = 8 +Msg = 61 +MD = 8ACA2602792AEC6F 11A67206531FB7D7 F0DFF59413145E69 73C45001D0087B42 D11BC645413AEFF6 3A42391A39145A59 1A92200D560195E5 3B478584FDAE231A + +# 3. In this example the data-string is the three-byte string consisting of the ASCII-coded version of 'abc'. + +# The hash-code is the following 512-bit string. + +Len = 24 +Msg = 616263 +MD = 4E2448A4C6F486BB 16B6562C73B4020B F3043E3A731BCE72 1AE1B303D97E6D4C 7181EEBDB6C57E27 7D0E34957114CBD6 C797FC9D95D8B582 D225292076D4EEF5 + +# 4. In this example the data-string is the 14-byte string consisting of the ASCII-coded version of 'message digest'. + +# The hash-code is the following 512-bit string. + +Len = 112 +Msg = 6d65737361676520646967657374 +MD = 378C84A4126E2DC6 E56DCC7458377AAC 838D00032230F53C E1F5700C0FFB4D3B 8421557659EF55C1 06B4B52AC5A4AAA6 92ED920052838F33 62E86DBD37A8903E + +# 5. In this example the data-string is the 26-byte string consisting of the ASCII-coded version of 'abcdefghijklmnopqrstuvwxyz'. + +# The hash-code is the following 512-bit string. + +Len = 208 +Msg = 6162636465666768696a6b6c6d6e6f707172737475767778797a +MD = F1D754662636FFE9 2C82EBB9212A484A 8D38631EAD4238F5 442EE13B8054E41B 08BF2A9251C30B6A 0B8AAE86177AB4A6 F68F673E7207865D 5D9819A3DBA4EB3B + +# 6. In this example the data-string is the 62-byte string consisting of the ASCII-coded version of 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'. + +# The hash-code is the following 512-bit string. + +Len = 496 +Msg = 4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373839 +MD = DC37E008CF9EE69B F11F00ED9ABA2690 1DD7C28CDEC066CC 6AF42E40F82F3A1E 08EBA26629129D8F B7CB57211B9281A6 5517CC879D7B9621 42C65F5A7AF01467 + +# 7. In this example the data-string is the 80-byte string consisting of the ASCII-coded version of eight repetitions of '1234567890'. + +# The hash-code is the following 512-bit string. + +Len = 640 +Msg = 3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930 +MD = 466EF18BABB0154D 25B9D38A6414F5C0 8784372BCCB204D6 549C4AFADB601429 4D5BD8DF2A6C44E5 38CD047B2681A51A 2C60481E88C5A20B 2C2A80CF3A9A083B + +# 8. In this example the data-string is the 32-byte string consisting of the ASCII-coded version of 'abcdbcdecdefdefgefghfghighijhijk'. + +# The hash-code is the following 512-bit string. + + +Len = 256 +Msg = 6162636462636465636465666465666765666768666768696768696a68696a6b +MD = 2A987EA40F917061 F5D6F0A0E4644F48 8A7A5A52DEEE6562 07C562F988E95C69 16BDC8031BC5BE1B 7B947639FE050B56 939BAAA0ADFF9AE6 745B7B181C3BE3FD + +# 9. In this example the data-string is the 1000000-byte string consisting of the ASCII-coded version of 'a' repeated 10^6 times. + +# The hash-code is the following 512-bit string. + +# this test is not loaded from the vectors since it uses code to generate the input string -- cgit v1.2.3