Skip to content

Commit

Permalink
field: Document return value of fe_sqrt()
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Jun 15, 2023
1 parent 67214f5 commit c66c30c
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.
* Performs {r = sqrt(a)} and returns 1 if sqrt(a) exists.
* Performs {r = sqrt(-a) and returns 0 otherwise; then sqrt(-a) exists.
* 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 c66c30c

Please sign in to comment.