Re-canonicalizes a payload and compares recomputed hash/HMAC against provided values to detect tampering