MCPcopy Create free account
hub / github.com/RustCrypto/utils / generator

Function generator

wycheproof2blb/src/aes_siv.rs:38–61  ·  view source on GitHub ↗
(data: &[u8], algorithm: &str, key_size: u32)

Source from the content-addressed store, hash-verified

36}
37
38pub fn generator(data: &[u8], algorithm: &str, key_size: u32) -> Vec<TestInfo> {
39 let suite: TestSuite = serde_json::from_slice(data).unwrap();
40 assert_eq!(algorithm, suite.suite.algorithm);
41
42 let mut infos = vec![];
43 for g in &suite.test_groups {
44 if key_size != 0 && g.key_size != key_size {
45 continue;
46 }
47 for tc in &g.tests {
48 infos.push(TestInfo {
49 data: vec![
50 tc.key.clone(),
51 tc.aad.clone(),
52 tc.msg.clone(),
53 tc.ct.clone(),
54 vec![case_result(&tc.case)],
55 ],
56 desc: description(&suite.suite, &tc.case),
57 });
58 }
59 }
60 infos
61}

Callers

nothing calls this directly

Calls 2

descriptionFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected