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

Function generator

wycheproof2blb/src/hkdf.rs:40–70  ·  view source on GitHub ↗
(data: &[u8], algorithm: &str, _key_size: u32)

Source from the content-addressed store, hash-verified

38}
39
40pub fn generator(data: &[u8], algorithm: &str, _key_size: u32) -> Vec<TestInfo> {
41 let suite: TestSuite = serde_json::from_slice(data).unwrap();
42 assert_eq!(algorithm, suite.suite.algorithm);
43
44 let mut infos = vec![];
45 for g in &suite.test_groups {
46 for tc in &g.tests {
47 if tc.case.result != wycheproof::CaseResult::Valid {
48 continue;
49 }
50 if tc.okm.len() != tc.size {
51 eprintln!(
52 "Skipping case {} with size={} != okm.len()={}",
53 tc.case.case_id,
54 tc.size,
55 tc.okm.len()
56 );
57 }
58 infos.push(TestInfo {
59 data: vec![
60 tc.ikm.clone(),
61 tc.salt.clone(),
62 tc.info.clone(),
63 tc.okm.clone(),
64 ],
65 desc: description(&suite.suite, &tc.case),
66 });
67 }
68 }
69 infos
70}

Callers

nothing calls this directly

Calls 3

descriptionFunction · 0.85
lenMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected