hacl-star 0.0.13

HACL*, a formally verified cryptographic library for Rust (binding to hacl-c).
extern crate hacl_star;

use hacl_star::hmac;


const KEY: &[u8] = b"key";
const INPUT: &[u8] = b"The quick brown fox jumps over the lazy dog";
const OUTPUT: [u8; 32] = [0xf7, 0xbc, 0x83, 0xf4, 0x30, 0x53, 0x84, 0x24, 0xb1, 0x32, 0x98, 0xe6, 0xaa, 0x6f, 0xb1, 0x43, 0xef, 0x4d, 0x59, 0xa1, 0x49, 0x46, 0x17, 0x59, 0x97, 0x47, 0x9d, 0xbc, 0x2d, 0x1a, 0x3c, 0xd8];

#[test]
fn test_hmac_sha256() {
    let mut output = [0; 32];
    hmac::hmac_sha256(&mut output, KEY, INPUT);
    assert_eq!(output, OUTPUT);
}