aboutsummaryrefslogtreecommitdiff
path: root/src/secp256k1/include/secp256k1_recovery.h
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2021-12-18 11:34:47 +0800
committerfanquake <fanquake@gmail.com>2021-12-18 14:47:44 +0800
commitc06cda3e48e9826043ebc5790a7bb505bfbf368c (patch)
tree77f0286bae3271a764e5db3f108e26395ed173ad /src/secp256k1/include/secp256k1_recovery.h
parent97b2fc03f666ccbadcd3a497303fb6577842d11f (diff)
parent314195c8be3bd7db0d5817c4fb3aa85c84363ce9 (diff)
downloadbitcoin-c06cda3e48e9826043ebc5790a7bb505bfbf368c.tar.xz
Merge bitcoin/bitcoin#23383: Update libsecp256k1 subtree to current master
314195c8be3bd7db0d5817c4fb3aa85c84363ce9 Remove unnecessary cast in CKey::SignSchnorr (Pieter Wuille) a1f76cdb22e3278a48d63dd23c1fe3308daedd8c Remove --disable-openssl-tests for libsecp256k1 configure (Pieter Wuille) 86dbc4d075decb82fbba837aaa283cf0561897ad Squashed 'src/secp256k1/' changes from be8d9c262f..0559fc6e41 (Pieter Wuille) Pull request description: The motivation for this bump is getting rid of a cast in `CKey::SignSchnorr`; the `aux_rand` argument isn't modified by the `secp256k1_schnorrsig_sign` function, but was marked as non-`const` anyway. This is fixed now (bitcoin-core/secp256k1#966), and the cast is removed in this PR. There are a few other relevant changes: * (bitcoin-core/secp256k1#956): replaces a runtime-computed table with a precomputed one; this adds arouns 1 MiB to the binary size, but is a step towards significantly simplifying the API. If 1 MiB is too much, it can be reduced by 2 or 4 (or more) for a slight verification performance reduction. * (bitcoin-core/secp256k1#983): removes (test/bench only) OpenSSL support entirely, removing the need to pass `--disable-openssl-tests` (see #23314). * (bitcoin-core/secp256k1#810): mild performance increase for 64-bit non-x86 platforms. * (bitcoin-core/secp256k1#1002): Make aux_rnd32==NULL behave identical to 0x0000..00 (which impacts BIP341/BIP342 signing in Bitcoin Core, making it more strictly BIP340 compliant, though not in a manner that affects security). ACKs for top commit: fanquake: ACK 314195c8be3bd7db0d5817c4fb3aa85c84363ce9 - this includes a nice simplification to the lilbsecp build system (and thus our build system), and fixes issues like #22854. Did a Guix build on x86 (above), as well as a build on arm64 (except for the arm64 host): Tree-SHA512: 0e048390fc148fbbdf5b98d9cce8c71067564e7d69d97b68347808a9bc45a04f4fc653c392c880d79d5d8b9cf282195520955581ac4f1595f6a948080cf5949d
Diffstat (limited to 'src/secp256k1/include/secp256k1_recovery.h')
-rw-r--r--src/secp256k1/include/secp256k1_recovery.h35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/secp256k1/include/secp256k1_recovery.h b/src/secp256k1/include/secp256k1_recovery.h
index aa16532ce8..0e2847db96 100644
--- a/src/secp256k1/include/secp256k1_recovery.h
+++ b/src/secp256k1/include/secp256k1_recovery.h
@@ -43,8 +43,9 @@ SECP256K1_API int secp256k1_ecdsa_recoverable_signature_parse_compact(
/** Convert a recoverable signature into a normal signature.
*
* Returns: 1
- * Out: sig: a pointer to a normal signature (cannot be NULL).
- * In: sigin: a pointer to a recoverable signature (cannot be NULL).
+ * Args: ctx: a secp256k1 context object.
+ * Out: sig: a pointer to a normal signature.
+ * In: sigin: a pointer to a recoverable signature.
*/
SECP256K1_API int secp256k1_ecdsa_recoverable_signature_convert(
const secp256k1_context* ctx,
@@ -55,10 +56,10 @@ SECP256K1_API int secp256k1_ecdsa_recoverable_signature_convert(
/** Serialize an ECDSA signature in compact format (64 bytes + recovery id).
*
* Returns: 1
- * Args: ctx: a secp256k1 context object
- * Out: output64: a pointer to a 64-byte array of the compact signature (cannot be NULL)
- * recid: a pointer to an integer to hold the recovery id (can be NULL).
- * In: sig: a pointer to an initialized signature object (cannot be NULL)
+ * Args: ctx: a secp256k1 context object.
+ * Out: output64: a pointer to a 64-byte array of the compact signature.
+ * recid: a pointer to an integer to hold the recovery id.
+ * In: sig: a pointer to an initialized signature object.
*/
SECP256K1_API int secp256k1_ecdsa_recoverable_signature_serialize_compact(
const secp256k1_context* ctx,
@@ -71,12 +72,14 @@ SECP256K1_API int secp256k1_ecdsa_recoverable_signature_serialize_compact(
*
* Returns: 1: signature created
* 0: the nonce generation function failed, or the secret key was invalid.
- * Args: ctx: pointer to a context object, initialized for signing (cannot be NULL)
- * Out: sig: pointer to an array where the signature will be placed (cannot be NULL)
- * In: msghash32: the 32-byte message hash being signed (cannot be NULL)
- * seckey: pointer to a 32-byte secret key (cannot be NULL)
- * noncefp: pointer to a nonce generation function. If NULL, secp256k1_nonce_function_default is used
- * ndata: pointer to arbitrary data used by the nonce generation function (can be NULL)
+ * Args: ctx: pointer to a context object, initialized for signing.
+ * Out: sig: pointer to an array where the signature will be placed.
+ * In: msghash32: the 32-byte message hash being signed.
+ * seckey: pointer to a 32-byte secret key.
+ * noncefp: pointer to a nonce generation function. If NULL,
+ * secp256k1_nonce_function_default is used.
+ * ndata: pointer to arbitrary data used by the nonce generation function
+ * (can be NULL for secp256k1_nonce_function_default).
*/
SECP256K1_API int secp256k1_ecdsa_sign_recoverable(
const secp256k1_context* ctx,
@@ -91,10 +94,10 @@ SECP256K1_API int secp256k1_ecdsa_sign_recoverable(
*
* Returns: 1: public key successfully recovered (which guarantees a correct signature).
* 0: otherwise.
- * Args: ctx: pointer to a context object, initialized for verification (cannot be NULL)
- * Out: pubkey: pointer to the recovered public key (cannot be NULL)
- * In: sig: pointer to initialized signature that supports pubkey recovery (cannot be NULL)
- * msghash32: the 32-byte message hash assumed to be signed (cannot be NULL)
+ * Args: ctx: pointer to a context object, initialized for verification.
+ * Out: pubkey: pointer to the recovered public key.
+ * In: sig: pointer to initialized signature that supports pubkey recovery.
+ * msghash32: the 32-byte message hash assumed to be signed.
*/
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_recover(
const secp256k1_context* ctx,