Skip to content

Commit 5a73f14

Browse files
committed
Mention that value is unspecified for In/Out parameters if the function returns 0
1 parent f03df0e commit 5a73f14

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

include/secp256k1.h

+10-5
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create(
588588
* secp256k1_ec_seckey_verify. 1 otherwise
589589
* Args: ctx: pointer to a context object
590590
* In/Out: seckey: pointer to the 32-byte private key to be negated. The private
591-
* key should be valid according to secp256k1_ec_seckey_verify
591+
* key should be valid according to secp256k1_ec_seckey_verify.
592+
* Value becomes unspecified if this function returns 0.
592593
* (cannot be NULL)
593594
*/
594595
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_negate(
@@ -614,7 +615,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_negate(
614615
* private key would be invalid (only when the tweak is the complement
615616
* of the private key). 1 otherwise.
616617
* Args: ctx: pointer to a context object (cannot be NULL).
617-
* In/Out: seckey: pointer to a 32-byte private key.
618+
* In/Out: seckey: pointer to a 32-byte private key. Value becomes unspecified if this
619+
* function returns 0. (cannot be NULL)
618620
* In: tweak: pointer to a 32-byte tweak.
619621
*/
620622
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
@@ -631,7 +633,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(
631633
* of the corresponding private key). 1 otherwise.
632634
* Args: ctx: pointer to a context object initialized for validation
633635
* (cannot be NULL).
634-
* In/Out: pubkey: pointer to a public key object.
636+
* In/Out: pubkey: pointer to a public key object. Value becomes unspecified if this
637+
* function returns 0. (cannot be NULL).
635638
* In: tweak: pointer to a 32-byte tweak.
636639
*/
637640
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(
@@ -644,7 +647,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(
644647
* Returns: 0 if the tweak was out of range (chance of around 1 in 2^128 for
645648
* uniformly random 32-byte arrays, or equal to zero. 1 otherwise.
646649
* Args: ctx: pointer to a context object (cannot be NULL).
647-
* In/Out: seckey: pointer to a 32-byte private key.
650+
* In/Out: seckey: pointer to a 32-byte private key. Value becomes unspecified if this
651+
* function returns 0. (cannot be NULL).
648652
* In: tweak: pointer to a 32-byte tweak.
649653
*/
650654
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(
@@ -658,7 +662,8 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(
658662
* uniformly random 32-byte arrays, or equal to zero. 1 otherwise.
659663
* Args: ctx: pointer to a context object initialized for validation
660664
* (cannot be NULL).
661-
* In/Out: pubkey: pointer to a public key object.
665+
* In/Out: pubkey: pointer to a public key object. Value becomes unspecified if this
666+
* function returns 0. (cannot be NULL).
662667
* In: tweak: pointer to a 32-byte tweak.
663668
*/
664669
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(

0 commit comments

Comments
 (0)