Update HMAC functions to return an error where relevant.