Function ring::hmac::verify [−][src]
pub fn verify(key: &Key, data: &[u8], tag: &[u8]) -> Result<(), Unspecified>
Calculates the HMAC of data
using the signing key key
, and verifies
whether the resultant value equals tag
, in one step.
This is logically equivalent to, but more efficient than, constructing a
Key
with the same value as key
and then using verify
.
The verification will be done in constant time to prevent timing attacks.