Skip to content

Commit 3c1a0fd

Browse files
Merge #1347: field: Document return value of fe_sqrt()
5779137 field: Document return value of fe_sqrt() (Tim Ruffing) Pull request description: ACKs for top commit: sipa: ACK 5779137 theStack: ACK 5779137 Tree-SHA512: 706f8c6a26bf85f6c23af3bb053173b2cdee6838dd930cb2b1e2f851f47cfebafccecbd7d84b8152f2fea12f0676c1ddd700bb32beebec3f3e0f4300e878d0f5
2 parents 705ce7e + 5779137 commit 3c1a0fd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/field.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,10 @@ static void secp256k1_fe_sqr(secp256k1_fe *r, const secp256k1_fe *a);
267267
/** Compute a square root of a field element.
268268
*
269269
* On input, a must be a valid field element with magnitude<=8; r need not be initialized.
270-
* Performs {r = sqrt(a)} or {r = sqrt(-a)}, whichever exists. The resulting value
271-
* represented by r will be a square itself. Variables r and a must not point to the same object.
270+
* If sqrt(a) exists, performs {r = sqrt(a)} and returns 1.
271+
* Otherwise, sqrt(-a) exists. The function performs {r = sqrt(-a)} and returns 0.
272+
* The resulting value represented by r will be a square itself.
273+
* Variables r and a must not point to the same object.
272274
* On output, r will have magnitude 1 but will not be normalized.
273275
*/
274276
static int secp256k1_fe_sqrt(secp256k1_fe * SECP256K1_RESTRICT r, const secp256k1_fe * SECP256K1_RESTRICT a);

0 commit comments

Comments
 (0)