(data: &[u8], algorithm: &str, _key_size: u32)
| 38 | } |
| 39 | |
| 40 | pub 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 | } |
nothing calls this directly
no test coverage detected