Andrew Poelstra
e354c5751d
ecdsa_s2c: rename anti-klepto to anti-exfil
2021-02-09 22:47:24 +00:00
Russell O'Connor
fb390c5299
Remove underscores from header defs.
...
This makes them consistent with other files and avoids reserved identifiers.
2021-01-23 14:48:35 -05:00
Tim Ruffing
328aaef22a
Merge #845 : Extract the secret key from a keypair
...
33cb3c2b1fc3f3fe46c6d0eab118248ea86c1f06 Add secret key extraction from keypair to constant time tests (Elichai Turkel)
36d9dc1e8e6e3b15d805f04c973a8784a78880f6 Add seckey extraction from keypair to the extrakeys tests (Elichai Turkel)
fc96aa73f5c7f62452847a31821890ff1f72a5a4 Add a function to extract the secretkey from a keypair (Elichai Turkel)
Pull request description:
With schnorrsig if you need to tweak the secret key (for BIP32) you must use the keypair API to get compatible secret/public keys which you do by calling `secp256k1_keypair_xonly_tweak_add()`, but after that there's no currently a way to extract the secret key back for storage.
so I added a `secp256k1_keypair_seckey` function to extract the key
ACKs for top commit:
jonasnick:
ACK 33cb3c2b1fc3f3fe46c6d0eab118248ea86c1f06
real-or-random:
ACK 33cb3c2b1fc3f3fe46c6d0eab118248ea86c1f06 code inspection, tests pass
Tree-SHA512: 11212db38c8b87a87e2dc35c4d6993716867b45215b94b20522b1b3164ca63d4c6bf5192a6bff0e9267b333779cc8164844c56669a94e9be72df9ef025ffcfd4
2021-01-12 10:56:14 +01:00
Tim Ruffing
673e551f4d
Merge #111 : Add ECDSA sign-to-contract module
...
47efb5e39a1bf6330bd3bf6bc4b4416c5ca11878 ecdsa-s2c: add ctime tests (Andrew Poelstra)
396b558273ce88969d4b0abc86e003f7557224f7 ecdsa-s2c: add anti-klepto protocol (Andrew Poelstra)
290dee566e14efa852d4e5437546f6a8ff8bfa1a ecdsa-s2c: add actual sign-to-contract functionality (Andrew Poelstra)
8e46cac5b31c3a3127d33d46466c29e97545cf16 ecdsa-s2c: block in module (Andrew Poelstra)
826bd04b43f823813c633449223595031d5c31f7 add eccommit functionality (Andrew Poelstra)
Pull request description:
This is a backport and rebase of https://github.com/bitcoin-core/secp256k1/pull/669
ACKs for top commit:
jonasnick:
ACK 47efb5e39a1bf6330bd3bf6bc4b4416c5ca11878
real-or-random:
ACK 47efb5e39a1bf6330bd3bf6bc4b4416c5ca11878
Tree-SHA512: e1f3ee3985bc77197eb57c03884b5d4a5f8733523bba50e11309f86388471c6265b7241e9856e1b80a88f4c268f2826c0394e26161292aa438b2246a1ad86aa1
2021-01-04 14:56:47 +01:00
Andrew Poelstra
396b558273
ecdsa-s2c: add anti-klepto protocol
...
Co-authored-by: Marko Bencun <mbencun+pgp@gmail.com>
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com>
2020-12-21 20:50:19 +00:00
Andrew Poelstra
290dee566e
ecdsa-s2c: add actual sign-to-contract functionality
...
Co-authored-by: Marko Bencun <mbencun+pgp@gmail.com>
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com>
2020-12-21 20:50:17 +00:00
Andrew Poelstra
8e46cac5b3
ecdsa-s2c: block in module
...
Co-authored-by: Marko Bencun <mbencun+pgp@gmail.com>
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com>
2020-12-21 20:49:41 +00:00
Andrew Poelstra
826bd04b43
add eccommit functionality
...
Co-authored-by: Marko Bencun <mbencun+pgp@gmail.com>
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com>
2020-12-21 20:49:41 +00:00
Elichai Turkel
36d9dc1e8e
Add seckey extraction from keypair to the extrakeys tests
2020-12-19 11:00:25 +02:00
Elichai Turkel
fc96aa73f5
Add a function to extract the secretkey from a keypair
2020-12-19 11:00:25 +02:00
Dimitris Apostolou
07aa4c70ff
Fix insecure links
2020-12-18 00:24:22 +02:00
Jonas Nick
f587f04e35
Rename msg32 to msghash32 in ecdsa_sign/verify and add explanation
2020-12-04 14:12:38 +00:00
Andrew Poelstra
29f9a7dc62
reduce test rounds for rangeproof and surjectionproof
2020-12-03 15:35:50 +00:00
Jonas Nick
b9d91b3ecb
musig: add pubkey_tweak_add function to allow taproot tweaking
2020-11-30 15:40:09 +00:00
Jonas Nick
38a8b20991
musig: fix memory leak in musig test
2020-11-13 16:05:37 +00:00
Jonas Nick
5b4eb18ec5
musig: shorten partial nonce byte array from 33 to 32 bytes
2020-11-13 16:05:37 +00:00
Jonas Nick
62f0b2d867
musig: make musig partial nonces byte arrays instead of "pubkeys"
2020-11-13 16:05:37 +00:00
Jonas Nick
73792e4a27
musig: represent a combined_nonce as an xonly_pubkey
2020-11-13 16:05:36 +00:00
Jonas Nick
2117e7466a
musig: improve variable naming and be consistent with schnorrsig module
...
session_initialize -> session_init
msg_is_set -> is_msg_set
is_negated -> pk_parity
nonce_is_negated -> nonce_parity
2020-11-13 16:05:36 +00:00
Jonas Nick
ebc31f1f9d
musig: add ARG_CHECKs to functions to help debuggability
2020-11-13 16:05:36 +00:00
Jonas Nick
ac2d0e6697
musig: add magic to session to detect if session is uninitalized
2020-11-13 16:05:36 +00:00
Jonas Nick
29b4bd85d7
musig: simplify state machine by adding explicit round to session struct
2020-11-13 16:05:36 +00:00
Jonas Nick
e0ced690cf
Rename rands64 to testrandi64
...
This is to make it consistent with upstream changes.
2020-11-05 22:07:30 +00:00
Jonas Nick
b0917f3de1
Merge remote-tracking branch 'upstream/master' into temp-merge-835
2020-11-05 20:21:38 +00:00
Jonas Nick
23900a0d86
Fix the MuSig module after integrating bip-schnorr updates
...
1. using xonly_pubkeys in MuSig for input public keys and the combined
pk. For that to work we need to store whether the MuSig aggregated point
has an even y in the session, may need to negate each signers secret
key and may need to negate each signers public key in
musig_partial_sig_verify.
2. using a tagged hash for the message hash.
3. use !fe_is_odd in place of fe_is_quad_var
2020-11-04 21:47:09 +00:00
Andrew Poelstra
005fe79262
Merge commit '8ab24e8d' into tmp
2020-11-04 21:46:54 +00:00
Andrew Poelstra
a11250330b
(actually) remove schnorrsig module
2020-11-04 21:45:18 +00:00
Tim Ruffing
e89278f211
Don't use reserved identifiers memczero and benchmark_verify_t
...
As identified in #829 and #833 . Fixes #829 .
Since we touch this anyway, this commit additionally makes the
identifiers in the benchmark files a little bit more consistent.
2020-10-20 15:00:19 +02:00
Andrew Poelstra
8b70795b5e
Fix BE platforms by updating endianness macros to match upstream
2020-10-12 13:44:16 +00:00
Tim Ruffing
6173839c90
Switch to our own memcmp function
...
Fixes #823 .
2020-10-11 10:39:20 -07:00
Pieter Wuille
a45c1fa63c
Rename testrand functions to have test in name
2020-09-25 20:50:43 -07:00
Pieter Wuille
8b7dcdd955
Add exhaustive test for extrakeys and schnorrsig
2020-09-18 14:11:38 -07:00
Pieter Wuille
08d7d89299
Make pubkey parsing test whether points are in the correct subgroup
2020-09-18 14:11:38 -07:00
Pieter Wuille
87af00b511
Abstract out challenge computation in schnorrsig
2020-09-18 14:11:38 -07:00
Pieter Wuille
39f67dd072
Support splitting exhaustive tests across cores
2020-09-18 14:11:02 -07:00
Pieter Wuille
b110c106fa
Change exhaustive test groups so they have a point with X=1
...
This enables testing overflow is correctly encoded in the recid, and
likely triggers more edge cases.
Also introduce a Sage script to generate the parameters.
2020-09-18 14:01:15 -07:00
Pieter Wuille
8bcd78cd79
Make secp256k1_scalar_b32 detect overflow in scalar_low
2020-09-18 14:01:15 -07:00
Pieter Wuille
c498366e5b
Move exhaustive tests for recovery to module
2020-09-18 14:01:15 -07:00
Jonas Nick
16ffa9d97c
schnorrsig: Add taproot test case
2020-09-06 19:00:08 +00:00
Jonas Nick
8dfd53ee3f
schnorrsig: Add benchmark for sign and verify
2020-09-06 19:00:08 +00:00
Jonas Nick
4e43520026
schnorrsig: Add BIP-340 compatible signing and verification
2020-09-06 19:00:03 +00:00
Jonas Nick
7332d2db6b
schnorrsig: Add BIP-340 nonce function
2020-09-06 19:00:03 +00:00
Jonas Nick
7a703fd97d
schnorrsig: Init empty experimental module
2020-09-06 19:00:03 +00:00
Jonas Nick
6fcb5b845d
extrakeys: Add keypair_xonly_tweak_add
2020-09-06 19:00:00 +00:00
Jonas Nick
58254463f9
extrakeys: Add keypair struct with create, pub and pub_xonly
2020-09-06 18:59:57 +00:00
Jonas Nick
910d9c284c
extrakeys: Add xonly_pubkey_tweak_add & xonly_pubkey_tweak_add_test
2020-09-06 18:59:57 +00:00
Jonas Nick
4cd2ee474d
extrakeys: Add xonly_pubkey with serialize, parse and from_pubkey
2020-09-06 18:59:50 +00:00
Jonas Nick
47e6618e11
extrakeys: Init empty experimental module
...
This is to prepare for xonly_pubkeys and keypairs.
2020-08-26 19:52:55 +00:00
Jason Davies
fabc8f74e7
Fix typo in MuSig documentation.
2020-07-24 14:59:36 +02:00
Jonas Nick
96201b4f6e
Require message in musig protocol in an earlier state. In particular,
...
remove the set_msg function and require the message in get_public_nonce
at the latest.
2020-07-24 14:59:36 +02:00