Abstract out verify logic for fe_clear

This commit is contained in:
Pieter Wuille
2022-01-31 17:15:41 -05:00
parent 19a2bfeeea
commit c701d9a471
4 changed files with 16 additions and 11 deletions

View File

@@ -194,6 +194,14 @@ SECP256K1_INLINE static void secp256k1_fe_set_int(secp256k1_fe *r, int a) {
r->normalized = 1;
secp256k1_fe_verify(r);
}
static void secp256k1_fe_impl_clear(secp256k1_fe *a);
SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe *a) {
a->magnitude = 0;
a->normalized = 1;
secp256k1_fe_impl_clear(a);
secp256k1_fe_verify(a);
}
#endif /* defined(VERIFY) */
#endif /* SECP256K1_FIELD_IMPL_H */