Skip to content

hmacVerify

hmacVerify(hash, blockSizeBytes, key, message, tag): boolean

Defined in: hmac-core.ts:54

Verifies tag against a freshly computed HMAC, comparing in constant time via @ac-kit/crypto-safe’s constantTimeBytesIsEqual. Unlike constantTimeBytesIsEqual itself — which throws on a length mismatch, since its own callers always know the expected length in advance — a length mismatch here is ordinary invalid input (the tag is attacker-controlled at this boundary, e.g. a modified or truncated tag from a Wycheproof "invalid" test vector) and simply fails verification rather than throwing.

(data) => Uint8Array

number

Uint8Array

Uint8Array

Uint8Array

boolean