Skip to main content

verify

Function verify 

pub fn verify(key: &Key, data: &[u8], tag: &[u8]) -> Result<(), Unspecified>
Available on crate features crypto and aws-lc only.
Expand description

Calculates the CMAC of data using the signing key key, and verifies whether the resultant value equals tag, in one step.

The verification is done in constant time to prevent timing attacks.

§Errors

error::Unspecified if the tag does not match or if CMAC calculation fails.