diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-09-07 11:10:02 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-09-07 11:10:02 +0700 |
commit | 38024d27b227a1b6a37ddd78ee8d6842524d116f (patch) | |
tree | b950cd8a726c67dbaf3be41e222eead83b5eca12 | |
parent | Avoid duplicate test execution (diff) | |
download | BouncyCastle.NET-ed25519-38024d27b227a1b6a37ddd78ee8d6842524d116f.tar.xz |
Correct 1605-bit test vector for SHA3-512
-rw-r--r-- | crypto/test/data/crypto/SHA3TestVectors.txt | 13 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/SHA3DigestTest.cs | 9 |
2 files changed, 8 insertions, 14 deletions
diff --git a/crypto/test/data/crypto/SHA3TestVectors.txt b/crypto/test/data/crypto/SHA3TestVectors.txt index 4818e0b0d..c6d0efafc 100644 --- a/crypto/test/data/crypto/SHA3TestVectors.txt +++ b/crypto/test/data/crypto/SHA3TestVectors.txt @@ -1,6 +1,9 @@ -# Test vectors for FIPS 202 - SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions +# Test vectors for FIPS 202 - SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions # # Downloaded 6th August, 2015 from http://csrc.nist.gov/groups/ST/toolkit/examples.html#aHashing +# +# NOTE: The 1605-bit test vectors were initially wrong. Corrections were published on 14th August, 2015 +# (SHA3-512 corrected on 3rd September, 2015). SHA3-224 sample of 0-bit message @@ -766,10 +769,10 @@ Msg as bit string 1 1 0 0 0 Hash val is - 01 54 15 42 D1 B0 6E BF 5A 01 BF A3 59 55 C5 FF - B8 7E C8 1E 64 BF 1B B8 BF EB DF 84 A6 40 6C FD - F9 30 33 19 D6 4A 23 08 B6 AF F6 17 02 E5 39 31 - 0F 98 BF 77 24 6E 7F 7D 51 CF 0D 0C 01 F4 60 23 + FC 4A 16 7C CB 31 A9 37 D6 98 FD E8 2B 04 34 8C + 95 39 B2 8F 0C 9D 3B 45 05 70 9C 03 81 23 50 E4 + 99 0E 96 22 97 4F 6E 57 5C 47 86 1C 0D 2E 63 8C + CF C2 02 3C 36 5B B6 0A 93 F5 28 55 06 98 78 6B SHA3-512 sample of 1630-bit message diff --git a/crypto/test/src/crypto/test/SHA3DigestTest.cs b/crypto/test/src/crypto/test/SHA3DigestTest.cs index b5c26c621..71f51f43b 100644 --- a/crypto/test/src/crypto/test/SHA3DigestTest.cs +++ b/crypto/test/src/crypto/test/SHA3DigestTest.cs @@ -170,15 +170,6 @@ namespace Org.BouncyCastle.Crypto.Tests int bits = v.Bits; int partialBits = bits % 8; - if (bits == 1605 && v.Algorithm.IndexOf("512") >= 0) - { - /* - * TODO The SHA3-512 1605-bit test vector appear to be invalid. The 1605-bit vectors for - * the other SHA3 lengths were originally wrong, but fixed 14th Aug, 2015. - */ - return; - } - //Console.WriteLine(v.Algorithm + " " + bits + "-bit"); //Console.WriteLine(Hex.ToHexString(v.Message).ToUpper()); //Console.WriteLine(Hex.ToHexString(v.Hash).ToUpper()); |