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

@@ -286,12 +286,8 @@ SECP256K1_INLINE static int secp256k1_fe_is_odd(const secp256k1_fe *a) {
return a->n[0] & 1;
}
SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe *a) {
SECP256K1_INLINE static void secp256k1_fe_impl_clear(secp256k1_fe *a) {
int i;
#ifdef VERIFY
a->magnitude = 0;
a->normalized = 1;
#endif
for (i=0; i<10; i++) {
a->n[i] = 0;
}