Skip to content

Commit 7583f2e

Browse files
authored
wycheproof2blb: secp384r1 support (#767)
Adds support for extracting secp384r1 test vectors from Wycheproof, in order to test the `p384` crate.
1 parent 7db8e31 commit 7583f2e

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_eq!(g.sha, "SHA-256");
58+
assert!(matches!(g.sha.as_str(), "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
@@ -121,6 +121,10 @@ fn main() {
121121
file: "ecdsa_secp256k1_sha256_test.json",
122122
generator: ecdsa::generator,
123123
},
124+
"secp384r1" => Algorithm {
125+
file: "ecdsa_secp384r1_sha384_test.json",
126+
generator: ecdsa::generator,
127+
},
124128
_ => panic!("Unrecognized algorithm '{}'", algorithm),
125129
};
126130

0 commit comments

Comments
 (0)