Tink-Rust: Message Authentication Code

Docs MSRV

This crate provides message authentication code (MAC) functionality, as described in the upstream Tink documentation.

Usage

```Rust fn main() -> Result<(), Box> { tinkmac::init(); let kh = tinkcore::keyset::Handle::new(&tinkmac::hmacsha256tag256keytemplate())?; let m = tinkmac::new(&kh)?;

let pt = b"this data needs to be MACed";
let mac = m.compute_mac(pt)?;
println!("'{}' => {}", String::from_utf8_lossy(pt), hex::encode(&mac));

assert!(m.verify_mac(&mac, b"this data needs to be MACed").is_ok());
println!("MAC verification succeeded.");
Ok(())

} ```

License

Apache License, Version 2.0

Disclaimer

This is not an officially supported Google product.