RustCrypto: CBC-MAC
Generic implementation of Cipher Block Chaining Message Authentication Code (CBC-MAC).
WARNING! The algorithm has known weaknesses in case of variable-length messages. See the linked Wikipedia article for more information.
Examples
use ;
use Des;
use hex;
// CBC-MAC with the DES block cipher is equivalent to DAA
type Daa = ;
// test from FIPS 113
let key = hex!;
let mut mac = new_from_slice.unwrap;
mac.update;
let correct = hex!;
mac.verify_slice.unwrap;
License
Licensed under either of:
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.