Skip to content

Commit c829fc3

Browse files
committed
Merge branch 'jack/update-wycheproof' into 'master'
chore(crypto): CRP-1488 Update the wycheproof test data Updates the `wycheproof` crate to 0.5, which contains the new Wycheproof datasets released in March 2023. See merge request dfinity-lab/public/ic!12266
2 parents c19b673 + df535c0 commit c829fc3

File tree

21 files changed

+129
-91
lines changed

21 files changed

+129
-91
lines changed

Cargo.Bazel.StaticOpenSSL.json.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"checksum": "9ab4c70d688fc847051fa83ea67a5b26978dd0d77273e25e582079017c625ed6",
2+
"checksum": "87a5af9327ba381852c335988c62c22781e11ca3f694a38d9056d943286614e3",
33
"crates": {
44
"abnf 0.12.0": {
55
"name": "abnf",
@@ -13766,7 +13766,7 @@
1376613766
"target": "wsl"
1376713767
},
1376813768
{
13769-
"id": "wycheproof 0.4.0",
13769+
"id": "wycheproof 0.5.0",
1377013770
"target": "wycheproof"
1377113771
},
1377213772
{
@@ -50151,8 +50151,8 @@
5015150151
},
5015250152
{
5015350153
"Binary": {
50154-
"crate_name": "exit",
50155-
"crate_root": "src/bin/exit.rs",
50154+
"crate_name": "sleep",
50155+
"crate_root": "src/bin/sleep.rs",
5015650156
"srcs": {
5015750157
"include": [
5015850158
"**/*.rs"
@@ -50175,8 +50175,8 @@
5017550175
},
5017650176
{
5017750177
"Binary": {
50178-
"crate_name": "sleep",
50179-
"crate_root": "src/bin/sleep.rs",
50178+
"crate_name": "exit",
50179+
"crate_root": "src/bin/exit.rs",
5018050180
"srcs": {
5018150181
"include": [
5018250182
"**/*.rs"
@@ -54654,13 +54654,13 @@
5465454654
},
5465554655
"license": "MIT"
5465654656
},
54657-
"wycheproof 0.4.0": {
54657+
"wycheproof 0.5.0": {
5465854658
"name": "wycheproof",
54659-
"version": "0.4.0",
54659+
"version": "0.5.0",
5466054660
"repository": {
5466154661
"Http": {
54662-
"url": "https://crates.io/api/v1/crates/wycheproof/0.4.0/download",
54663-
"sha256": "183c789620c674b79dac33cd3aadb6c8006b66cba6a680402235aaebc743e3df"
54662+
"url": "https://crates.io/api/v1/crates/wycheproof/0.5.0/download",
54663+
"sha256": "ccaef718f69c19f7f66faacc10f747180ceb4883a53c35548be4cac4cec1591c"
5466454664
}
5466554665
},
5466654666
"targets": [
@@ -54703,8 +54703,8 @@
5470354703
],
5470454704
"selects": {}
5470554705
},
54706-
"edition": "2018",
54707-
"version": "0.4.0"
54706+
"edition": "2021",
54707+
"version": "0.5.0"
5470854708
},
5470954709
"license": "Apache-2.0"
5471054710
},

Cargo.Bazel.StaticOpenSSL.toml.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10084,9 +10084,9 @@ checksum = "f8dab7ac864710bdea6594becbea5b5050333cf34fefb0dc319567eb347950d4"
1008410084

1008510085
[[package]]
1008610086
name = "wycheproof"
10087-
version = "0.4.0"
10087+
version = "0.5.0"
1008810088
source = "registry+https://github.com/rust-lang/crates.io-index"
10089-
checksum = "183c789620c674b79dac33cd3aadb6c8006b66cba6a680402235aaebc743e3df"
10089+
checksum = "ccaef718f69c19f7f66faacc10f747180ceb4883a53c35548be4cac4cec1591c"
1009010090
dependencies = [
1009110091
"base64 0.13.1",
1009210092
"hex",

Cargo.Bazel.json.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"checksum": "ab80b814e81e0f34b3bede1529dc3855eb18e6f5dd5fe7ca547337e23d1a7b3c",
2+
"checksum": "6ee9224073d1c20dd9523a8a061a5500f3716a0c62b19612a3da665af44d9c13",
33
"crates": {
44
"abnf 0.12.0": {
55
"name": "abnf",
@@ -13766,7 +13766,7 @@
1376613766
"target": "wsl"
1376713767
},
1376813768
{
13769-
"id": "wycheproof 0.4.0",
13769+
"id": "wycheproof 0.5.0",
1377013770
"target": "wycheproof"
1377113771
},
1377213772
{
@@ -54630,13 +54630,13 @@
5463054630
},
5463154631
"license": "MIT"
5463254632
},
54633-
"wycheproof 0.4.0": {
54633+
"wycheproof 0.5.0": {
5463454634
"name": "wycheproof",
54635-
"version": "0.4.0",
54635+
"version": "0.5.0",
5463654636
"repository": {
5463754637
"Http": {
54638-
"url": "https://crates.io/api/v1/crates/wycheproof/0.4.0/download",
54639-
"sha256": "183c789620c674b79dac33cd3aadb6c8006b66cba6a680402235aaebc743e3df"
54638+
"url": "https://crates.io/api/v1/crates/wycheproof/0.5.0/download",
54639+
"sha256": "ccaef718f69c19f7f66faacc10f747180ceb4883a53c35548be4cac4cec1591c"
5464054640
}
5464154641
},
5464254642
"targets": [
@@ -54679,8 +54679,8 @@
5467954679
],
5468054680
"selects": {}
5468154681
},
54682-
"edition": "2018",
54683-
"version": "0.4.0"
54682+
"edition": "2021",
54683+
"version": "0.5.0"
5468454684
},
5468554685
"license": "Apache-2.0"
5468654686
},

Cargo.Bazel.toml.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10084,9 +10084,9 @@ checksum = "f8dab7ac864710bdea6594becbea5b5050333cf34fefb0dc319567eb347950d4"
1008410084

1008510085
[[package]]
1008610086
name = "wycheproof"
10087-
version = "0.4.0"
10087+
version = "0.5.0"
1008810088
source = "registry+https://github.com/rust-lang/crates.io-index"
10089-
checksum = "183c789620c674b79dac33cd3aadb6c8006b66cba6a680402235aaebc743e3df"
10089+
checksum = "ccaef718f69c19f7f66faacc10f747180ceb4883a53c35548be4cac4cec1591c"
1009010090
dependencies = [
1009110091
"base64 0.13.1",
1009210092
"hex",

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bazel/external_crates.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ def external_crates_repository(name, static_openssl, cargo_lockfile, lockfile):
12371237
version = "^0.1.0",
12381238
),
12391239
"wycheproof": crate.spec(
1240-
version = "^0.4",
1240+
version = "^0.5",
12411241
),
12421242
"x509-parser": crate.spec(
12431243
version = "^0.12.0",

rs/crypto/ecdsa_secp256k1/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ lazy_static = "1.4"
1515

1616
[dev-dependencies]
1717
hex = "0.4"
18-
wycheproof = "0.4"
18+
wycheproof = "0.5"

rs/crypto/ecdsa_secp256k1/tests/tests.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ fn should_pass_wycheproof_ecdsa_secp256k1_verification_tests() -> Result<(), Key
1616
// The Wycheproof ECDSA tests do not normalize s so we must use
1717
// the verification method that accepts either valid s
1818
let accepted = pk.verify_signature_with_malleability(&test.msg, &test.sig);
19-
20-
if accepted {
21-
assert_eq!(test.result, wycheproof::TestResult::Valid);
22-
} else if test.result != wycheproof::TestResult::Invalid {
23-
assert!(test.flags.contains(&TestFlag::SigSize));
24-
}
19+
assert_eq!(accepted, test.result == wycheproof::TestResult::Valid);
2520
}
2621
}
2722

rs/crypto/ecdsa_secp256r1/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ ic-crypto-getrandom-for-wasm = { path = "../getrandom_for_wasm" }
1717

1818
[dev-dependencies]
1919
hex = "0.4"
20-
wycheproof = "0.4"
20+
wycheproof = "0.5"

rs/crypto/ecdsa_secp256r1/tests/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ fn should_pass_wycheproof_ecdsa_secp256r1_verification_tests() -> Result<(), Key
1717

1818
if accepted {
1919
assert_eq!(test.result, wycheproof::TestResult::Valid);
20-
} else if test.result != wycheproof::TestResult::Invalid {
21-
assert!(test.flags.contains(&TestFlag::SigSize));
20+
} else {
21+
assert_eq!(test.result, wycheproof::TestResult::Invalid);
2222
}
2323
}
2424
}

0 commit comments

Comments
 (0)