Function orion::default::hmac_validate [] [src]

pub fn hmac_validate(
    expected_hmac: &[u8],
    secret_key: &[u8],
    message: &[u8]
) -> bool

Validate an HMAC against a key and message.

Usage example:

use orion::default;
use orion::util;

let key = util::gen_rand_key(64);
let msg = "Some message.".as_bytes();

let expected_hmac = default::hmac(&key, msg);
assert_eq!(default::hmac_validate(&expected_hmac, &key, &msg), true);