Skip to content

Commit 131f871

Browse files
jonasnickreal-or-random
authored andcommitted
doc: clarify API doc of secp256k1_ecdsa_recover return value
Co-authored-by: Tim Ruffing <[email protected]>
1 parent 36e7695 commit 131f871

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

include/secp256k1_recovery.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,17 @@ SECP256K1_API int secp256k1_ecdsa_sign_recoverable(
9292

9393
/** Recover an ECDSA public key from a signature.
9494
*
95-
* Returns: 1: public key successfully recovered (which guarantees a correct signature).
95+
* Successful public key recovery guarantees that the signature, after normalization,
96+
* passes `secp256k1_ecdsa_verify`. Thus, explicit verification is not necessary.
97+
*
98+
* However, a non-recoverable signature converted from a recoverable signature
99+
* (using `secp256k1_ecdsa_recoverable_signature_convert`) is not guaranteed
100+
* to be normalized and thus not guaranteed to pass `secp256k1_ecdsa_verify`
101+
* (even if it passes `secp256k1_ecdsa_recover`). If a normalized signature is
102+
* required, call `secp256k1_ecdsa_signature_normalize` after
103+
* `secp256k1_ecdsa_recoverable_signature_convert`.
104+
*
105+
* Returns: 1: public key successfully recovered
96106
* 0: otherwise.
97107
* Args: ctx: pointer to a context object.
98108
* Out: pubkey: pointer to the recovered public key.

0 commit comments

Comments
 (0)