Bitcoin Core 28.99.0
P2P Digital Currency
secp256k1_musig.h
Go to the documentation of this file.
1#ifndef SECP256K1_MUSIG_H
2#define SECP256K1_MUSIG_H
3
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#include <stddef.h>
11#include <stdint.h>
12
44 unsigned char data[197];
46
60 unsigned char data[132];
62
69 unsigned char data[132];
71
78 unsigned char data[132];
80
88 unsigned char data[133];
90
97 unsigned char data[36];
99
108 const secp256k1_context *ctx,
110 const unsigned char *in66
112
121 const secp256k1_context *ctx,
122 unsigned char *out66,
125
134 const secp256k1_context *ctx,
136 const unsigned char *in66
138
147 const secp256k1_context *ctx,
148 unsigned char *out66,
151
160 const secp256k1_context *ctx,
162 const unsigned char *in32
164
173 const secp256k1_context *ctx,
174 unsigned char *out32,
177
200 const secp256k1_context *ctx,
202 secp256k1_musig_keyagg_cache *keyagg_cache,
203 const secp256k1_pubkey * const *pubkeys,
204 size_t n_pubkeys
206
220 const secp256k1_context *ctx,
221 secp256k1_pubkey *agg_pk,
222 const secp256k1_musig_keyagg_cache *keyagg_cache
224
263 const secp256k1_context *ctx,
264 secp256k1_pubkey *output_pubkey,
265 secp256k1_musig_keyagg_cache *keyagg_cache,
266 const unsigned char *tweak32
268
305 const secp256k1_context *ctx,
306 secp256k1_pubkey *output_pubkey,
307 secp256k1_musig_keyagg_cache *keyagg_cache,
308 const unsigned char *tweak32
310
363 const secp256k1_context *ctx,
364 secp256k1_musig_secnonce *secnonce,
365 secp256k1_musig_pubnonce *pubnonce,
366 unsigned char *session_secrand32,
367 const unsigned char *seckey,
368 const secp256k1_pubkey *pubkey,
369 const unsigned char *msg32,
370 const secp256k1_musig_keyagg_cache *keyagg_cache,
371 const unsigned char *extra_input32
373
374
426 const secp256k1_context *ctx,
427 secp256k1_musig_secnonce *secnonce,
428 secp256k1_musig_pubnonce *pubnonce,
429 uint64_t nonrepeating_cnt,
430 const secp256k1_keypair *keypair,
431 const unsigned char *msg32,
432 const secp256k1_musig_keyagg_cache *keyagg_cache,
433 const unsigned char *extra_input32
435
456 const secp256k1_context *ctx,
457 secp256k1_musig_aggnonce *aggnonce,
458 const secp256k1_musig_pubnonce * const *pubnonces,
459 size_t n_pubnonces
461
475 const secp256k1_context *ctx,
477 const secp256k1_musig_aggnonce *aggnonce,
478 const unsigned char *msg32,
479 const secp256k1_musig_keyagg_cache *keyagg_cache
481
515 const secp256k1_context *ctx,
516 secp256k1_musig_partial_sig *partial_sig,
517 secp256k1_musig_secnonce *secnonce,
518 const secp256k1_keypair *keypair,
519 const secp256k1_musig_keyagg_cache *keyagg_cache,
520 const secp256k1_musig_session *session
522
556 const secp256k1_context *ctx,
557 const secp256k1_musig_partial_sig *partial_sig,
558 const secp256k1_musig_pubnonce *pubnonce,
559 const secp256k1_pubkey *pubkey,
560 const secp256k1_musig_keyagg_cache *keyagg_cache,
561 const secp256k1_musig_session *session
563
577 const secp256k1_context *ctx,
578 unsigned char *sig64,
579 const secp256k1_musig_session *session,
580 const secp256k1_musig_partial_sig * const *partial_sigs,
581 size_t n_sigs
583
584#ifdef __cplusplus
585}
586#endif
587
588#endif
unsigned int nonce
Definition: miner_tests.cpp:74
#define SECP256K1_ARG_NONNULL(_x)
Definition: secp256k1.h:176
#define SECP256K1_API
Definition: secp256k1.h:161
#define SECP256K1_WARN_UNUSED_RESULT
Definition: secp256k1.h:171
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_pubkey_ec_tweak_add(const secp256k1_context *ctx, secp256k1_pubkey *output_pubkey, secp256k1_musig_keyagg_cache *keyagg_cache, const unsigned char *tweak32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Apply plain "EC" tweaking to a public key in a given keyagg_cache by adding the generator multiplied ...
Definition: keyagg_impl.h:283
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_pubkey_xonly_tweak_add(const secp256k1_context *ctx, secp256k1_pubkey *output_pubkey, secp256k1_musig_keyagg_cache *keyagg_cache, const unsigned char *tweak32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Apply x-only tweaking to a public key in a given keyagg_cache by adding the generator multiplied with...
Definition: keyagg_impl.h:287
SECP256K1_API int secp256k1_musig_aggnonce_serialize(const secp256k1_context *ctx, unsigned char *out66, const secp256k1_musig_aggnonce *nonce) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Serialize an aggregate public nonce.
Definition: session_impl.h:257
struct secp256k1_musig_session secp256k1_musig_session
Opaque data structure that holds a MuSig session.
struct secp256k1_musig_aggnonce secp256k1_musig_aggnonce
Opaque data structure that holds an aggregate public nonce.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_partial_sig_parse(const secp256k1_context *ctx, secp256k1_musig_partial_sig *sig, const unsigned char *in32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Parse a MuSig partial signature.
Definition: session_impl.h:275
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_pubnonce_parse(const secp256k1_context *ctx, secp256k1_musig_pubnonce *nonce, const unsigned char *in66) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Parse a signer's public nonce.
Definition: session_impl.h:194
SECP256K1_API int secp256k1_musig_nonce_agg(const secp256k1_context *ctx, secp256k1_musig_aggnonce *aggnonce, const secp256k1_musig_pubnonce *const *pubnonces, size_t n_pubnonces) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Aggregates the nonces of all signers into a single nonce.
Definition: session_impl.h:536
SECP256K1_API int secp256k1_musig_partial_sign(const secp256k1_context *ctx, secp256k1_musig_partial_sig *partial_sig, secp256k1_musig_secnonce *secnonce, const secp256k1_keypair *keypair, const secp256k1_musig_keyagg_cache *keyagg_cache, const secp256k1_musig_session *session) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(6)
Produces a partial signature.
Definition: session_impl.h:658
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_aggnonce_parse(const secp256k1_context *ctx, secp256k1_musig_aggnonce *nonce, const unsigned char *in66) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Parse an aggregate public nonce.
Definition: session_impl.h:240
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_pubkey_get(const secp256k1_context *ctx, secp256k1_pubkey *agg_pk, const secp256k1_musig_keyagg_cache *keyagg_cache) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Obtain the aggregate public key from a keyagg_cache.
Definition: keyagg_impl.h:233
struct secp256k1_musig_partial_sig secp256k1_musig_partial_sig
Opaque data structure that holds a partial MuSig signature.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_nonce_gen(const secp256k1_context *ctx, secp256k1_musig_secnonce *secnonce, secp256k1_musig_pubnonce *pubnonce, unsigned char *session_secrand32, const unsigned char *seckey, const secp256k1_pubkey *pubkey, const unsigned char *msg32, const secp256k1_musig_keyagg_cache *keyagg_cache, const unsigned char *extra_input32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(6)
Starts a signing session by generating a nonce.
Definition: session_impl.h:461
SECP256K1_API int secp256k1_musig_partial_sig_serialize(const secp256k1_context *ctx, unsigned char *out32, const secp256k1_musig_partial_sig *sig) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Serialize a MuSig partial signature.
Definition: session_impl.h:294
struct secp256k1_musig_pubnonce secp256k1_musig_pubnonce
Opaque data structure that holds a signer's public nonce.
struct secp256k1_musig_secnonce secp256k1_musig_secnonce
Opaque data structure that holds a signer's secret nonce.
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_partial_sig_verify(const secp256k1_context *ctx, const secp256k1_musig_partial_sig *partial_sig, const secp256k1_musig_pubnonce *pubnonce, const secp256k1_pubkey *pubkey, const secp256k1_musig_keyagg_cache *keyagg_cache, const secp256k1_musig_session *session) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5) SECP256K1_ARG_NONNULL(6)
Verifies an individual signer's partial signature.
Definition: session_impl.h:728
SECP256K1_API int secp256k1_musig_partial_sig_agg(const secp256k1_context *ctx, unsigned char *sig64, const secp256k1_musig_session *session, const secp256k1_musig_partial_sig *const *partial_sigs, size_t n_sigs) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Aggregates partial signatures.
Definition: session_impl.h:791
struct secp256k1_musig_keyagg_cache secp256k1_musig_keyagg_cache
This module implements BIP 327 "MuSig2 for BIP340-compatible Multi-Signatures" (https://github....
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_nonce_gen_counter(const secp256k1_context *ctx, secp256k1_musig_secnonce *secnonce, secp256k1_musig_pubnonce *pubnonce, uint64_t nonrepeating_cnt, const secp256k1_keypair *keypair, const unsigned char *msg32, const secp256k1_musig_keyagg_cache *keyagg_cache, const unsigned char *extra_input32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(5)
Alternative way to generate a nonce and start a signing session.
Definition: session_impl.h:489
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_pubkey_agg(const secp256k1_context *ctx, secp256k1_xonly_pubkey *agg_pk, secp256k1_musig_keyagg_cache *keyagg_cache, const secp256k1_pubkey *const *pubkeys, size_t n_pubkeys) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(4)
Computes an aggregate public key and uses it to initialize a keyagg_cache.
Definition: keyagg_impl.h:175
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_musig_nonce_process(const secp256k1_context *ctx, secp256k1_musig_session *session, const secp256k1_musig_aggnonce *aggnonce, const unsigned char *msg32, const secp256k1_musig_keyagg_cache *keyagg_cache) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5)
Takes the aggregate nonce and creates a session that is required for signing and verification of part...
Definition: session_impl.h:612
SECP256K1_API int secp256k1_musig_pubnonce_serialize(const secp256k1_context *ctx, unsigned char *out66, const secp256k1_musig_pubnonce *nonce) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Serialize a signer's public nonce.
Definition: session_impl.h:214
Opaque data structure that holds a keypair consisting of a secret and a public key.
Opaque data structure that holds an aggregate public nonce.
unsigned char data[132]
This module implements BIP 327 "MuSig2 for BIP340-compatible Multi-Signatures" (https://github....
Opaque data structure that holds a partial MuSig signature.
Opaque data structure that holds a signer's public nonce.
unsigned char data[132]
Opaque data structure that holds a signer's secret nonce.
unsigned char data[132]
Opaque data structure that holds a MuSig session.
unsigned char data[133]
Opaque data structure that holds a parsed and valid public key.
Definition: secp256k1.h:61
Opaque data structure that holds a parsed and valid "x-only" public key.