Skip to content

Commit

Permalink
Add invariant checking to group elements
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed May 10, 2023
1 parent a18821d commit f202667
Show file tree
Hide file tree
Showing 2 changed files with 191 additions and 5 deletions.
8 changes: 8 additions & 0 deletions src/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,12 @@ static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *b);
*/
static int secp256k1_ge_is_in_correct_subgroup(const secp256k1_ge* ge);

#ifdef VERIFY
/** Check invariants on an affine group element. */
static void secp256k1_ge_verify(const secp256k1_ge *a);

/** Check invariants on a Jacobian group element. */
static void secp256k1_gej_verify(const secp256k1_gej *a);
#endif

#endif /* SECP256K1_GROUP_H */

0 comments on commit f202667

Please sign in to comment.