optimizing hmac authentication