Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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:

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top