Skip to main content

verify_hmac

Function verify_hmac 

Source
pub fn verify_hmac(
    hmac_key: &[u8],
    header_bytes: &[u8],
    secrets_bytes: &[u8],
    expected_hmac: &[u8],
) -> Result<()>
Expand description

Verify that the HMAC matches using constant-time comparison.

Uses hmac::Mac::verify_slice which is guaranteed constant-time, preventing timing side-channel attacks.