I'm interested in implementing Keccak (SHA-3) and would like a set of input/expected output pairs to test against. Have any official test vectors been released? I recall having some for the other SHA routines and they were very helpful.
Asked
Active
Viewed 5,945 times
3
-
1NOTE: SHA-3 is not standardized as of this writing. It will use Keccak, but NIST hasn't published any specification for which rates to use etc. – u0b34a0f6ae Mar 04 '13 at 13:23
2 Answers
6
Yes. See the "Known-answer and Monte Carlo test results" bullet on the downloads page, or go straight to the file. There are whole-message test vectors as well as files describing inputs and outputs for the individual intermediate stages.
And of course, you can always run the reference implementation and compare outputs.

willglynn
- 11,210
- 48
- 40
2
Have Keccak (SHA-3) example hashes (test vectors) been made available?
Yes. The NIST test vectors can be found at SHA-3 Reference and Optimized Implementations. The page includes:
- Description of Known Answer Test (KAT) and Monte Carlo Test (MCT) for SHA-3 Candidate Algorithm Submissions
- Test files and Source Code for Conducting KAT and MCT
These tests may be different from the Keccak test vectors because NIST modified some things. So, for SHA-3, I would specifically use what NIST provides.

jww
- 97,681
- 90
- 411
- 885