Refactor error handling in calcHmac() function.
Refactor crypto.go tests to use a helper instead of write bytes by hand.
Refactor crypto.go error handling.