Skip to content

Commit

Permalink
introduce and use SECP256K1_{FE,GE,GEJ}_VERIFY macros
Browse files Browse the repository at this point in the history
By providing an uppercase variant of these verification functions, it is
better visible that it is test code and surrounding `#ifdef VERIFY`
blocks can be removed (if there is no other code around that could
remain in production mode), as they don't serve their purpose any more.

At some places intentional blank lines are inserted for grouping and
better readadbility.
  • Loading branch information
theStack committed Aug 4, 2023
1 parent e55f903 commit 3c7b907
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 152 deletions.
2 changes: 2 additions & 0 deletions src/field.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,10 @@ static int secp256k1_fe_is_square_var(const secp256k1_fe *a);

/** Check invariants on a field element (no-op unless VERIFY is enabled). */
static void secp256k1_fe_verify(const secp256k1_fe *a);
#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)

/** Check that magnitude of a is at most m (no-op unless VERIFY is enabled). */
static void secp256k1_fe_verify_magnitude(const secp256k1_fe *a, int m);
#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)

#endif /* SECP256K1_FIELD_H */
Loading

0 comments on commit 3c7b907

Please sign in to comment.