Even though it's trivial, a test or two would be nice.
The deps_test changes are fine.
https://codereview.appspot.com/6632044/diff/2002/src/pkg/crypto/hmac/hmac.go
File src/pkg/crypto/hmac/hmac.go (right):
https://codereview.appspot.com/6632044/diff/2002/src/pkg/crypto/hmac/hmac.go#newcode10
src/pkg/crypto/hmac/hmac.go:10: Receivers should be careful to use
Verify to compare MACs in order to avoid
new paragraph here (insert blank line above this one)
https://codereview.appspot.com/6632044/diff/2002/src/pkg/crypto/hmac/hmac.go#newcode95
src/pkg/crypto/hmac/hmac.go:95: // Verify compares two MACs for equality
without leaking timing information.
I'd prefer to use a name that is more clearly boolean. Also the
variables could be named to make clearer that the arguments are the
MACs.
func Equal(mac1, mac2 []byte) bool
?
On a related note, I was expecting Verify to be more of a helper. If you
want to make it dead simple to use correctly, I wonder if you should
add:
func Sign(h func() hash.Hash, key, msg []byte) (mac []byte)
func Verify(h func() hash.Hash, key, msg, mac []byte) error
https://codereview.appspot.com/6632044/