xref: /aosp_15_r20/external/cronet/third_party/rust/chromium_crates_io/vendor/wycheproof-0.4.0/src/mac.rs (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 //! Message Authentication Code tests
2 
3 use super::*;
4 
5 define_test_set!("MAC", "mac_test_schema.json");
6 
7 define_test_set_names!(
8     AesCmac => "aes_cmac",
9     HmacSha1 => "hmac_sha1",
10     HmacSha224 => "hmac_sha224",
11     HmacSha256 => "hmac_sha256",
12     HmacSha384 => "hmac_sha384",
13     HmacSha512 => "hmac_sha512",
14     HmacSha3_224 => "hmac_sha3_224",
15     HmacSha3_256 => "hmac_sha3_256",
16     HmacSha3_384 => "hmac_sha3_384",
17     HmacSha3_512 => "hmac_sha3_512",
18 );
19 
20 define_algorithm_map!(
21     "AES-CMAC" => AesCmac,
22     "HMACSHA1" => HmacSha1,
23     "HMACSHA224" => HmacSha224,
24     "HMACSHA256" => HmacSha256,
25     "HMACSHA384" => HmacSha384,
26     "HMACSHA512" => HmacSha512,
27     "HMACSHA3-224" => HmacSha3_224,
28     "HMACSHA3-256" => HmacSha3_256,
29     "HMACSHA3-384" => HmacSha3_384,
30     "HMACSHA3-512" => HmacSha3_512,
31 );
32 
33 define_typeid!(TestGroupTypeId => "MacTest");
34 
35 define_test_flags!();
36 
37 define_test_group!(
38     "keySize" => key_size: usize,
39     "tagSize" => tag_size: usize,
40 );
41 
42 define_test!(key: Vec<u8>, msg: Vec<u8>, tag: Vec<u8>,);
43