@@ -13,21 +13,21 @@ extern "C" {
1313 * Returns: 1: signature created
1414 * 0: the nonce generation function failed, or the private key was
1515 * invalid.
16- * In: ctx: pointer to a context object, initialized for signing
16+ * Args: ctx: pointer to a context object, initialized for signing
1717 * (cannot be NULL)
18- * msg32: the 32-byte message hash being signed (cannot be NULL)
18+ * Out: sig64: pointer to a 64-byte array where the signature will be
19+ * placed (cannot be NULL)
20+ * In: msg32: the 32-byte message hash being signed (cannot be NULL)
1921 * seckey: pointer to a 32-byte secret key (cannot be NULL)
2022 * noncefp:pointer to a nonce generation function. If NULL,
2123 * secp256k1_nonce_function_default is used
2224 * ndata: pointer to arbitrary data used by the nonce generation
2325 * function (can be NULL)
24- * Out: sig64: pointer to a 64-byte array where the signature will be
25- * placed (cannot be NULL)
2626 */
2727int secp256k1_schnorr_sign (
2828 const secp256k1_context_t * ctx ,
29- const unsigned char * msg32 ,
3029 unsigned char * sig64 ,
30+ const unsigned char * msg32 ,
3131 const unsigned char * seckey ,
3232 secp256k1_nonce_function_t noncefp ,
3333 const void * ndata
@@ -36,15 +36,15 @@ int secp256k1_schnorr_sign(
3636/** Verify a signature created by secp256k1_schnorr_sign.
3737 * Returns: 1: correct signature
3838 * 0: incorrect signature
39- * In: ctx: a secp256k1 context object, initialized for verification.
39+ * Args: ctx: a secp256k1 context object, initialized for verification.
40+ * In: sig64: the 64-byte signature being verified (cannot be NULL)
4041 * msg32: the 32-byte message hash being verified (cannot be NULL)
41- * sig64: the 64-byte signature being verified (cannot be NULL)
4242 * pubkey: the public key to verify with (cannot be NULL)
4343 */
4444SECP256K1_WARN_UNUSED_RESULT int secp256k1_schnorr_verify (
4545 const secp256k1_context_t * ctx ,
46- const unsigned char * msg32 ,
4746 const unsigned char * sig64 ,
47+ const unsigned char * msg32 ,
4848 const secp256k1_pubkey_t * pubkey
4949) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 );
5050
@@ -53,47 +53,47 @@ SECP256K1_WARN_UNUSED_RESULT int secp256k1_schnorr_verify(
5353 * Returns: 1: public key successfully recovered (which guarantees a correct
5454 * signature).
5555 * 0: otherwise.
56- * In: ctx: pointer to a context object, initialized for
56+ * Args: ctx: pointer to a context object, initialized for
5757 * verification (cannot be NULL)
58- * msg32: the 32-byte message hash assumed to be signed (cannot
59- * be NULL)
60- * sig64: signature as 64 byte array (cannot be NULL)
6158 * Out: pubkey: pointer to a pubkey to set to the recovered public key
6259 * (cannot be NULL).
60+ * In: sig64: signature as 64 byte array (cannot be NULL)
61+ * msg32: the 32-byte message hash assumed to be signed (cannot
62+ * be NULL)
6363 */
6464int secp256k1_schnorr_recover (
6565 const secp256k1_context_t * ctx ,
66- const unsigned char * msg32 ,
66+ secp256k1_pubkey_t * pubkey ,
6767 const unsigned char * sig64 ,
68- secp256k1_pubkey_t * pubkey
68+ const unsigned char * msg32
6969) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 );
7070
7171/** Generate a nonce pair deterministically for use with
7272 * secp256k1_schnorr_partial_sign.
7373 * Returns: 1: valid nonce pair was generated.
7474 * 0: otherwise (nonce generation function failed)
75- * In: ctx: pointer to a context object, initialized for signing
75+ * Args: ctx: pointer to a context object, initialized for signing
7676 * (cannot be NULL)
77- * msg32: the 32-byte message hash assumed to be signed (cannot
77+ * Out: pubnonce: public side of the nonce (cannot be NULL)
78+ * privnonce32: private side of the nonce (32 byte) (cannot be NULL)
79+ * In: msg32: the 32-byte message hash assumed to be signed (cannot
7880 * be NULL)
7981 * sec32: the 32-byte private key (cannot be NULL)
8082 * noncefp: pointer to a nonce generation function. If NULL,
8183 * secp256k1_nonce_function_default is used
8284 * noncedata: pointer to arbitrary data used by the nonce generation
8385 * function (can be NULL)
84- * Out: pubnonce: public side of the nonce (cannot be NULL)
85- * privnonce32: private side of the nonce (32 byte) (cannot be NULL)
8686 *
8787 * Do not use the output as a private/public key pair for signing/validation.
8888 */
8989int secp256k1_schnorr_generate_nonce_pair (
9090 const secp256k1_context_t * ctx ,
91+ secp256k1_pubkey_t * pubnonce ,
92+ unsigned char * privnonce32 ,
9193 const unsigned char * msg32 ,
9294 const unsigned char * sec32 ,
9395 secp256k1_nonce_function_t noncefp ,
94- const void * noncedata ,
95- secp256k1_pubkey_t * pubnonce ,
96- unsigned char * privnonce32
96+ const void * noncedata
9797) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (6 ) SECP256K1_ARG_NONNULL (7 );
9898
9999/** Produce a partial Schnorr signature, which can be combined using
@@ -103,14 +103,14 @@ int secp256k1_schnorr_generate_nonce_pair(
103103 * 0: no valid signature exists with this combination of keys, nonces
104104 * and message (chance around 1 in 2^128)
105105 * -1: invalid private key, nonce, or public nonces.
106- * In: ctx: pointer to context object, initialized for signing (cannot
106+ * Args: ctx: pointer to context object, initialized for signing (cannot
107107 * be NULL)
108- * msg32: pointer to 32-byte message to sign
108+ * Out: sig64: pointer to 64-byte array to put partial signature in
109+ * In: msg32: pointer to 32-byte message to sign
109110 * sec32: pointer to 32-byte private key
110- * secnonce32: pointer to 32-byte array containing our nonce
111111 * pubnonce_others: pointer to pubkey containing the sum of the other's
112112 * nonces (see secp256k1_ec_pubkey_combine)
113- * Out: sig64: pointer to 64 -byte array to put partial signature in
113+ * secnonce32: pointer to 32 -byte array containing our nonce
114114 *
115115 * The intended procedure for creating a multiparty signature is:
116116 * - Each signer S[i] with private key x[i] and public key Q[i] runs
@@ -140,31 +140,31 @@ int secp256k1_schnorr_generate_nonce_pair(
140140 */
141141SECP256K1_WARN_UNUSED_RESULT int secp256k1_schnorr_partial_sign (
142142 const secp256k1_context_t * ctx ,
143- const unsigned char * msg32 ,
144143 unsigned char * sig64 ,
144+ const unsigned char * msg32 ,
145145 const unsigned char * sec32 ,
146- const unsigned char * secnonce32 ,
147- const secp256k1_pubkey_t * pubnonce_others
146+ const secp256k1_pubkey_t * pubnonce_others ,
147+ const unsigned char * secnonce32
148148) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 ) SECP256K1_ARG_NONNULL (6 );
149149
150150/** Combine multiple Schnorr partial signatures.
151151 * Returns: 1: the passed signatures were succesfully combined.
152152 * 0: the resulting signature is not valid (chance of 1 in 2^256)
153153 * -1: some inputs were invalid, or the signatures were not created
154154 * using the same set of nonces
155- * In: ctx: pointer to a context object
156- * sig64: pointer to a 64-byte array to place the combined signature
155+ * Args: ctx: pointer to a context object
156+ * Out: sig64: pointer to a 64-byte array to place the combined signature
157157 * (cannot be NULL)
158- * n: the number of signatures to combine (at least 1)
159- * Out: sig64sin: pointer to an array of n pointers to 64-byte input
158+ * In: sig64sin: pointer to an array of n pointers to 64-byte input
160159 * signatures
160+ * n: the number of signatures to combine (at least 1)
161161 */
162162SECP256K1_WARN_UNUSED_RESULT int secp256k1_schnorr_partial_combine (
163163 const secp256k1_context_t * ctx ,
164164 unsigned char * sig64 ,
165- int n ,
166- const unsigned char * const * sig64sin
167- ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (4 );
165+ const unsigned char * const * sig64sin ,
166+ int n
167+ ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 );
168168
169169# ifdef __cplusplus
170170}
0 commit comments