replace HMAC equality check with a constant-time comparison