Skip to content
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 src/ecmult_gen_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp25
* but this would simply discard the bits that fall off at the bottom,
* and thus, for example, bitdata could still have only two values if we
* happen to shift by exactly 31 positions. We use a rotation instead,
* which ensures that bitdata doesn't loose entropy. This relies on the
* which ensures that bitdata doesn't lose entropy. This relies on the
* rotation being atomic, i.e., the compiler emitting an actual rot
* instruction. */
uint32_t bitdata = secp256k1_rotr32(recoded[bit_pos >> 5], bit_pos & 0x1f);
Expand Down
4 changes: 2 additions & 2 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -3904,7 +3904,7 @@ static void test_ge(void) {
free(gej);
}

static void test_intialized_inf(void) {
static void test_initialized_inf(void) {
secp256k1_ge p;
secp256k1_gej pj, npj, infj1, infj2, infj3;
secp256k1_fe zinv;
Expand Down Expand Up @@ -4030,7 +4030,7 @@ static void run_ge(void) {
test_ge();
}
test_add_neg_y_diff_x();
test_intialized_inf();
test_initialized_inf();
test_ge_bytes();
}

Expand Down
4 changes: 2 additions & 2 deletions src/wycheproof/WYCHEPROOF_COPYING
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* The file `ecdsa_secp256k1_sha256_bitcoin_test.json` in this directory
comes from project Wycheproof with git commit
`df4e933efef449fc88af0c06e028d425d84a9495`, see
https://github.com/C2SP/wycheproof/blob/df4e933efef449fc88af0c06e028d425d84a9495/testvectors_v1/ecdsa_secp256k1_sha256_bitcoin_test.json
`1f32ea7bb6cc5bd111cbd5507456b255dc8337c3`, see
https://github.com/C2SP/wycheproof/blob/1f32ea7bb6cc5bd111cbd5507456b255dc8337c3/testvectors_v1/ecdsa_secp256k1_sha256_bitcoin_test.json

* The file `ecdh_secp256k1_test.json` in this directory
comes from project Wycheproof with git commit
Expand Down
10 changes: 5 additions & 5 deletions src/wycheproof/ecdsa_secp256k1_sha256_bitcoin_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"numberOfTests" : 463,
"header" : [
"Test vectors of type EcdsaBitcoinVerify are meant for the verification",
"of a ECDSA variant used for bitcoin, that add signature non-malleability."
"of a ECDSA variant used for Bitcoin, that add signature non-malleability."
],
"notes" : {
"ArithmeticError" : {
Expand Down Expand Up @@ -47,7 +47,7 @@
"InvalidSignature" : {
"bugType" : "AUTH_BYPASS",
"description" : "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.",
"effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.",
"effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowing the message to sign.",
"cves" : [
"CVE-2022-21449",
"CVE-2021-43572",
Expand All @@ -57,7 +57,7 @@
"InvalidTypesInSignature" : {
"bugType" : "AUTH_BYPASS",
"description" : "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.",
"effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowning the message to sign.",
"effect" : "Accepting such signatures can have the effect that an adversary can forge signatures without even knowing the message to sign.",
"cves" : [
"CVE-2022-21449"
]
Expand Down Expand Up @@ -95,8 +95,8 @@
},
"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 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",
"description" : "Signature malleability can be a serious issue in Bitcoin. An implementation should only accept a signature s where s < n/2. If an implementation is not meant for use cases that require signature malleability then this implementation should be tested with another set of test vectors.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment should read something like:

Suggested change
"description" : "Signature malleability can be a serious issue in Bitcoin. An implementation should only accept a signature s where s < n/2. If an implementation is not meant for use cases that require signature malleability then this implementation should be tested with another set of test vectors.",
"description" : "Signature malleability can be a serious issue in Bitcoin. An implementation should only accept a signature s where s < n/2. If an implementation is meant for use cases that require signature malleability then this implementation should be tested with another set of test vectors.",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one test vector has the SignatureMalleabilityBitcoin flag and it tests a failing signature. So I cannot make sense of the original descriptioin either. Maybe it should say something like:

If an implementation is meant for use cases that tolarete signature malleability then this implementation should not be tested with this set of test vectors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened C2SP/wycheproof#153 upstream, will pipe through the changes to here if/when the upstream PR is merged.

"effect" : "In Bitcoin exchanges, it may be used to make a double deposits or double withdrawals",
"links" : [
"https://en.bitcoin.it/wiki/Transaction_malleability",
"https://en.bitcoinwiki.org/wiki/Transaction_Malleability"
Expand Down