1. API: This exposes a minimal API: the SHA-3 functions implement hash.Hash. The SHAKE functions implement a new "ShakeHash" interface that implements io.Reader, io.Writer, and Reset(). (The previous Barrier() function has been removed.) (Alternative proposal: Don't implement io.Reader, but instead provide a "Digest(d []byte) error" function that performs a hash.Hash style copy. Somewhat more minimal, but very easy to use incorrectly.) 2. Tests Added the complete set of ShortMsgKATs from https://github.com/gvanas/KeccakCodePackage 3. Correctness In sync with draft FIPS-202. 4. Documentation A summary of the security properties of the SHA-3 and SHAKE functions is provided in doc.go; some concrete recommendations as well. Fixes 8563. R=golang-codereviews, agl CC=golang-codereviews https://golang.org/cl/130950043
509 KiB
509 KiB