204 Commits

Author SHA1 Message Date
Andrew Poelstra
ff4714e641
Merge pull request #105 from jonasnick/update-musig
MuSig state machine simplifictions, API improvements and taproot tweaking
2020-11-30 16:11:34 +00:00
Jonas Nick
b9d91b3ecb musig: add pubkey_tweak_add function to allow taproot tweaking 2020-11-30 15:40:09 +00:00
Thomas Eizinger
4d20713425
Remove unused context initializer functions
Fixes #15.
2020-11-24 10:43:28 +11: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
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
Andrew Poelstra
a3a3a17f47
Merge pull request #94 from apoelstra/temp-merge-1309c03c45beece646a7d21fdb6a0e3d38adee2b
[upstream PR #773]: Fix some compile problems on weird/old compilers.
2020-09-25 14:23:54 +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
Gregory Maxwell
1309c03c45 Fix some compile problems on weird/old compilers.
The visibility attribute is a GCC 4+ feature.
GCC 2.95 also warns about the unsigned/signed comparision.
2020-07-26 05:26:56 +00: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
Jonas Nick
b368a5d163 Fix ARG_NONNULL macro usage in musig include 2020-07-24 14:59:36 +02:00
Jonas Nick
bedff79848 Add cplusplus directive to musig include 2020-07-24 14:59:36 +02:00
Jonas Nick
d924027765 Add tweak32 parameter to musig_partial_sig_combine which allows to sign for p2c/taproot commitments 2020-07-24 14:59:36 +02:00
Roman Zeyde
bd70820123 allow reducing surjection proof size (to lower generation stack usage) 2020-07-24 14:59:36 +02:00
Andrew Poelstra
56f69d979f surjectionproof: introduce SECP256K1_SURJECTIONPROOF_MAX_USED_INPUTS constant and set it to 16 2020-07-24 14:59:36 +02:00
Dmitry Petukhov
2dc868f35b work in progress: add _allocate_initialized/destroy funcs 2020-07-24 14:59:36 +02:00
Roman Zeyde
f35b5e271f Fix a small typo in the generator parameter name 2020-07-24 14:59:36 +02:00
Andrew Poelstra
3424cb1fa3 musig: add user documentation 2020-07-24 14:59:36 +02:00
Jonas Nick
13ef445721 Add 3-of-3 MuSig example 2020-07-24 14:59:36 +02:00
Jonas Nick
b86c210747 Add MuSig module which allows creating n-of-n multisignatures and adaptor signatures. 2020-07-24 14:59:36 +02:00
Andrew Poelstra
c59c602dd6 Add schnorrsig module which implements BIP-schnorr [0] compatible signing, verification and batch verification.
[0] https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki
2020-07-24 14:59:36 +02:00
Jonas Nick
f416e039bb Add comment to explain effect of max_n_iterations in surjectionproof_init 2020-07-24 14:50:49 +02:00
Andrew Poelstra
edb879f578 rangeproof: verify correctness of pedersen commitments when parsing 2020-07-24 14:50:48 +02:00
Andrew Poelstra
fca4c3b62f generator: verify correctness of point when parsing 2020-07-24 14:50:48 +02:00
Frank V. Castellucci
0c5cb7cd08 Expose generator in shared library
Was failing linking to `*.so` library
2020-07-24 14:50:48 +02:00
Gregory Sanders
dbc49df80c fix spelling in documentation 2020-07-24 14:50:48 +02:00
Andrew Poelstra
4320490e88 generator: add API tests 2020-07-24 14:49:33 +02:00
Jonas Nick
3997128ad9 Fix pedersen_blind_generator_blind_sum return value documentation 2020-07-24 14:49:33 +02:00
Jonas Nick
04f4c09111 Add n_keys argument to whitelist_verify 2020-07-24 14:49:33 +02:00
Jonas Nick
dbf3d752a8 Fix checks of whitelist serialize/parse arguments 2020-07-24 14:49:33 +02:00
Andrew Poelstra
29d0d562dc whitelist: fix serialize/parse API to take serialized length 2020-07-24 14:49:33 +02:00
Jonas Nick
660ad39fb3 Fix include/secp256k1_rangeproof.h function argument documentation. 2020-07-24 14:49:33 +02:00
Andrew Poelstra
e13bdf2f23 rangeproof: add API tests 2020-07-24 14:49:33 +02:00
Andrew Poelstra
ba8b4f53ef add surjection proof module
Includes fix and tests by Jonas Nick.
2020-07-24 14:49:33 +02:00
Andrew Poelstra
8c77fe1590 Implement ring-signature based whitelist delegation scheme 2020-07-24 14:49:33 +02:00
Andrew Poelstra
94425d4a67 rangeproof: several API changes
* add summing function for blinded generators
* drop `excess` and `gen` from `verify_tally`
* add extra_commit to rangeproof sign and verify
2020-07-24 14:49:33 +02:00