Skip to content

tests: update wycheproof files #1670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ We strongly recommend updating to 0.3.1 if you use or plan to use Clang >=14 to
- Fix "constant-timeness" issue with Clang >=14 that could leave applications using libsecp256k1 vulnerable to a timing side-channel attack. The fix avoids secret-dependent control flow and secret-dependent memory accesses in conditional moves of memory objects when libsecp256k1 is compiled with Clang >=14.

#### Added
- Added tests against [Project Wycheproof's](https://github.com/google/wycheproof/) set of ECDSA test vectors (Bitcoin "low-S" variant), a fixed set of test cases designed to trigger various edge cases.
- Added tests against [Project Wycheproof's](https://github.com/C2SP/wycheproof/) set of ECDSA test vectors (Bitcoin "low-S" variant), a fixed set of test cases designed to trigger various edge cases.

#### Changed
- Increased minimum required CMake version to 3.13. CMake builds remain experimental.
Expand Down
12 changes: 6 additions & 6 deletions src/wycheproof/WYCHEPROOF_COPYING
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
* The file `ecdsa_secp256k1_sha256_bitcoin_test.json` in this directory
comes from Google's project Wycheproof with git commit
`b063b4aedae951c69df014cd25fa6d69ae9e8cb9`, see
https://github.com/google/wycheproof/blob/b063b4aedae951c69df014cd25fa6d69ae9e8cb9/testvectors_v1/ecdsa_secp256k1_sha256_bitcoin_test.json
comes from project Wycheproof with git commit
`df4e933efef449fc88af0c06e028d425d84a9495`, see
https://github.com/C2SP/wycheproof/blob/df4e933efef449fc88af0c06e028d425d84a9495/testvectors_v1/ecdsa_secp256k1_sha256_bitcoin_test.json

* The file `ecdh_secp256k1_test.json` in this directory
comes from Google's project Wycheproof with git commit
`d9f6ec7d8bd8c96da05368999094e4a75ba5cb3d`, see
https://github.com/google/wycheproof/blob/d9f6ec7d8bd8c96da05368999094e4a75ba5cb3d/testvectors_v1/ecdh_secp256k1_test.json
comes from project Wycheproof with git commit
`df4e933efef449fc88af0c06e028d425d84a9495`, see
https://github.com/C2SP/wycheproof/blob/df4e933efef449fc88af0c06e028d425d84a9495/testvectors_v1/ecdh_secp256k1_test.json

* The file `ecdsa_secp256k1_sha256_bitcoin_test.h` is generated from
`ecdsa_secp256k1_sha256_bitcoin_test.json` using the script
Expand Down
5 changes: 4 additions & 1 deletion src/wycheproof/ecdh_secp256k1_test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"algorithm" : "ECDH",
"schema" : "ecdh_test_schema.json",
"generatorVersion" : "0.9rc5",
"numberOfTests" : 752,
"header" : [
"Test vectors of type EcdhTest are intended for",
Expand Down Expand Up @@ -124,6 +123,10 @@
"testGroups" : [
{
"type" : "EcdhTest",
"source" : {
"name" : "google-wycheproof",
"version" : "0.9rc5"
},
"curve" : "secp256k1",
"encoding" : "asn",
"tests" : [
Expand Down
4 changes: 2 additions & 2 deletions src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"notes" : {
"ArithmeticError" : {
"bugType" : "EDGE_CASE",
"description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurences.",
"description" : "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurrences.",
"cves" : [
"CVE-2017-18146"
]
Expand Down Expand Up @@ -95,7 +95,7 @@
},
"SignatureMalleabilityBitcoin" : {
"bugType" : "SIGNATURE_MALLEABILITY",
"description" : "\"BitCoins\"-curves are curves where signature malleability can be a serious issue. An implementation should only accept a signature s where s < n/2. If an implementation is not meant for uses cases that require signature malleability then this implemenation should be tested with another set of test vectors.",
"description" : "\"BitCoins\"-curves are curves where signature malleability can be a serious issue. An implementation should only accept a signature s where s < n/2. If an implementation is not meant for uses cases that require signature malleability then this implementation should be tested with another set of test vectors.",
"effect" : "In bitcoin exchanges, it may be used to make a double deposits or double withdrawals",
"links" : [
"https://en.bitcoin.it/wiki/Transaction_malleability",
Expand Down