Skip to content

Commit

Permalink
wycheproof2blb: secp224r1 support (#891)
Browse files Browse the repository at this point in the history
Adds support for extracting secp224r1 test vectors from Wycheproof, in
order to test the `p224` crate.
  • Loading branch information
tarcieri authored Apr 10, 2023
1 parent b8bd42f commit b326398
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion wycheproof2blb/src/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn generator(data: &[u8], algorithm: &str, _key_size: u32) -> Vec<TestInfo>
let mut infos = vec![];
for g in &suite.test_groups {
assert_eq!(g.key.curve, algorithm);
assert!(matches!(g.sha.as_str(), "SHA-256" | "SHA-384"));
assert!(matches!(g.sha.as_str(), "SHA-224" | "SHA-256" | "SHA-384"));
for tc in &g.tests {
if tc.case.result == crate::wycheproof::CaseResult::Acceptable {
// TODO: figure out what to do with test cases that pass but which have weak params
Expand Down
4 changes: 4 additions & 0 deletions wycheproof2blb/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ fn main() {
file: "eddsa_test.json",
generator: ed25519::generator,
},
"secp224r1" => Algorithm {
file: "ecdsa_secp224r1_sha224_test.json",
generator: ecdsa::generator,
},
"secp256r1" => Algorithm {
file: "ecdsa_secp256r1_sha256_test.json",
generator: ecdsa::generator,
Expand Down

0 comments on commit b326398

Please sign in to comment.