Skip to content

Commit

Permalink
wycheproof2blb: secp256k1 with P1363 format (#1092)
Browse files Browse the repository at this point in the history
parsing ecdsa_secp256k1_sha256_p1363_test.json
  • Loading branch information
XuJiandong authored Jul 27, 2024
1 parent 8a652e2 commit 030ae1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wycheproof2blb/src/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,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!(algorithm.starts_with(&g.key.curve));
assert!(matches!(
g.sha.as_str(),
"SHA-224" | "SHA-256" | "SHA-384" | "SHA-512"
Expand Down
5 changes: 4 additions & 1 deletion wycheproof2blb/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ fn main() {
file: "ecdsa_secp256r1_sha256_test.json",
generator: ecdsa::generator,
},
// There's also "ecdsa_secp256r1_sha256_p1363_test.json" with a different signature encoding.
"secp256k1" => Algorithm {
file: "ecdsa_secp256k1_sha256_test.json",
generator: ecdsa::generator,
},
"secp256k1-p1316" => Algorithm {
file: "ecdsa_secp256k1_sha256_p1363_test.json",
generator: ecdsa::generator,
},
"secp384r1" => Algorithm {
file: "ecdsa_secp384r1_sha384_test.json",
generator: ecdsa::generator,
Expand Down

0 comments on commit 030ae1d

Please sign in to comment.