Skip to content

Commit 3c64f87

Browse files
jonasnicktheStack
authored andcommitted
doc: clarify API doc of secp256k1_ecdsa_recover return value
1 parent 36e7695 commit 3c64f87

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

include/secp256k1_recovery.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,15 @@ 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, when normalized,
96+
* passes `secp256k1_ecdsa_verify`. Thus, explicit verification is not necessary.
97+
*
98+
* A recoverable signature converted to a normal signature may not pass
99+
* `secp256k1_ecdsa_verify` if it is not normalized. If a normalized signature is
100+
* required, call `secp256k1_ecdsa_signature_normalize` after
101+
* `secp256k1_ecdsa_recover`.
102+
*
103+
* Returns: 1: public key successfully recovered
96104
* 0: otherwise.
97105
* Args: ctx: pointer to a context object.
98106
* Out: pubkey: pointer to the recovered public key.

0 commit comments

Comments
 (0)