Comply with golint.

Also renamed HashAlgorithm to HashFunc, since that's really what it is.
Reuse buffers for HMACs.
gofmt