Skip to content

Commit b326398

Browse files
authored
wycheproof2blb: secp224r1 support (#891)
Adds support for extracting secp224r1 test vectors from Wycheproof, in order to test the `p224` crate.
1 parent b8bd42f commit b326398

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

wycheproof2blb/src/ecdsa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn generator(data: &[u8], algorithm: &str, _key_size: u32) -> Vec<TestInfo>
5555
let mut infos = vec![];
5656
for g in &suite.test_groups {
5757
assert_eq!(g.key.curve, algorithm);
58-
assert!(matches!(g.sha.as_str(), "SHA-256" | "SHA-384"));
58+
assert!(matches!(g.sha.as_str(), "SHA-224" | "SHA-256" | "SHA-384"));
5959
for tc in &g.tests {
6060
if tc.case.result == crate::wycheproof::CaseResult::Acceptable {
6161
// TODO: figure out what to do with test cases that pass but which have weak params

wycheproof2blb/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ fn main() {
112112
file: "eddsa_test.json",
113113
generator: ed25519::generator,
114114
},
115+
"secp224r1" => Algorithm {
116+
file: "ecdsa_secp224r1_sha224_test.json",
117+
generator: ecdsa::generator,
118+
},
115119
"secp256r1" => Algorithm {
116120
file: "ecdsa_secp256r1_sha256_test.json",
117121
generator: ecdsa::generator,

0 commit comments

Comments
 (0)