Skip to content

Commit

Permalink
docs: correct pubkey param descriptions for `secp256k1_keypair_{xon…
Browse files Browse the repository at this point in the history
…ly_,}pub`

The functions `secp256k1_keypair_pub` and `secp256k1_keypair_xonly_pub`
always succeed (i.e. return the value 1), so the other cases in the
`pubkey` parameter descriptions never happen and can hence be removed.

Note that the "1 always" return value description was previously done in
commit b8f8b99 (PR bitcoin-core#1089), which also
explains why invalid objects of type secp256k1_pubkey are in practice
not possible.
  • Loading branch information
theStack committed Jun 11, 2023
1 parent 60556c9 commit f686785
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions include/secp256k1_extrakeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_sec(
/** Get the public key from a keypair.
*
* Returns: 1 always.
* Args: ctx: pointer to a context object.
* Out: pubkey: pointer to a pubkey object. If 1 is returned, it is set to
* the keypair public key. If not, it's set to an invalid value.
* Args: ctx: pointer to a context object.
* Out: pubkey: pointer to a pubkey object, set to the keypair public key.
* In: keypair: pointer to a keypair.
*/
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_pub(
Expand All @@ -203,9 +202,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_keypair_pub(
*
* Returns: 1 always.
* Args: ctx: pointer to a context object.
* Out: pubkey: pointer to an xonly_pubkey object. If 1 is returned, it is set
* to the keypair public key after converting it to an
* xonly_pubkey. If not, it's set to an invalid value.
* Out: pubkey: pointer to an xonly_pubkey object, set to the keypair
* public key after converting it to an xonly_pubkey.
* pk_parity: Ignored if NULL. Otherwise, pointer to an integer that will be set to the
* pk_parity argument of secp256k1_xonly_pubkey_from_pubkey.
* In: keypair: pointer to a keypair.
Expand Down

0 comments on commit f686785

Please sign in to comment.