Skip to content

Commit 70b6be1

Browse files
committed
extrakeys: improve doc of keypair_create (don't suggest retry)
1 parent 01b5893 commit 70b6be1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

include/secp256k1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ SECP256K1_API int secp256k1_ecdsa_sign(
684684
* A secret key is valid if it is not 0 and less than the secp256k1 curve order
685685
* when interpreted as an integer (most significant byte first). The
686686
* probability of choosing a 32-byte string uniformly at random which is an
687-
* invalid secret key is negligible. However, if it does happen it should
687+
* invalid secret key is negligible. However, if it does happen it should
688688
* be assumed that the randomness source is severely broken and there should
689689
* be no retry.
690690
*

include/secp256k1_extrakeys.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,13 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_xonly_pubkey_tweak_add_
155155
const unsigned char *tweak32
156156
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(4) SECP256K1_ARG_NONNULL(5);
157157

158-
/** Compute the keypair for a secret key.
158+
/** Compute the keypair for a valid secret key.
159159
*
160-
* Returns: 1: secret was valid, keypair is ready to use
161-
* 0: secret was invalid, try again with a different secret
160+
* See the documentation of `secp256k1_ec_seckey_verify` for more information
161+
* about the validity of secret keys.
162+
*
163+
* Returns: 1: secret key is valid
164+
* 0: secret key is invalid
162165
* Args: ctx: pointer to a context object (not secp256k1_context_static).
163166
* Out: keypair: pointer to the created keypair.
164167
* In: seckey: pointer to a 32-byte secret key.

0 commit comments

Comments
 (0)