Skip to content

Commit

Permalink
field: Document return value of fe_sqrt()
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Nick <jonasd.nick@gmail.com>
  • Loading branch information
real-or-random and jonasnick committed Jun 20, 2023
1 parent 67214f5 commit 5779137
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/field.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,10 @@ static void secp256k1_fe_sqr(secp256k1_fe *r, const secp256k1_fe *a);
/** Compute a square root of a field element.
*
* On input, a must be a valid field element with magnitude<=8; r need not be initialized.
* Performs {r = sqrt(a)} or {r = sqrt(-a)}, whichever exists. The resulting value
* represented by r will be a square itself. Variables r and a must not point to the same object.
* If sqrt(a) exists, performs {r = sqrt(a)} and returns 1.
* Otherwise, sqrt(-a) exists. The function performs {r = sqrt(-a)} and returns 0.
* The resulting value represented by r will be a square itself.
* Variables r and a must not point to the same object.
* On output, r will have magnitude 1 but will not be normalized.
*/
static int secp256k1_fe_sqrt(secp256k1_fe * SECP256K1_RESTRICT r, const secp256k1_fe * SECP256K1_RESTRICT a);
Expand Down

0 comments on commit 5779137

Please sign in to comment.