Skip to content

Commit

Permalink
field.h: improve doc of fe_equal_var
Browse files Browse the repository at this point in the history
- `_fe_equal` requires both the inputs magnitude to be 1
- `_fe_equal_var` requires only the first input magnitude to be 1
  • Loading branch information
siv2r committed Jan 4, 2022
1 parent a1102b1 commit ae7bb57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/field.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ static int secp256k1_fe_is_zero(const secp256k1_fe *a);
/** Check the "oddness" of a field element. Requires the input to be normalized. */
static int secp256k1_fe_is_odd(const secp256k1_fe *a);

/** Compare two field elements. Requires magnitude-1 inputs. */
/** Compare two field elements. Requires both the inputs to have magnitude = 1.
* i.e. a->magnitude = 1 and b->magnitude = 1 */
static int secp256k1_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b);

/** Same as secp256k1_fe_equal, but may be variable time. */
/** Same as secp256k1_fe_equal, but may be variable time.
* Requires only the first input to have magnitude = 1.
* i.e. a->magnitude = 1 */
static int secp256k1_fe_equal_var(const secp256k1_fe *a, const secp256k1_fe *b);

/** Compare two field elements. Requires both inputs to be normalized */
Expand Down

0 comments on commit ae7bb57

Please sign in to comment.