@@ -2991,8 +2991,7 @@ static int check_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b) {
2991
2991
secp256k1_fe an = * a ;
2992
2992
secp256k1_fe bn = * b ;
2993
2993
secp256k1_fe_normalize_weak (& an );
2994
- secp256k1_fe_normalize_var (& bn );
2995
- return secp256k1_fe_equal_var (& an , & bn );
2994
+ return secp256k1_fe_equal (& an , & bn );
2996
2995
}
2997
2996
2998
2997
static void run_field_convert (void ) {
@@ -3015,9 +3014,9 @@ static void run_field_convert(void) {
3015
3014
secp256k1_fe_storage fes2 ;
3016
3015
/* Check conversions to fe. */
3017
3016
CHECK (secp256k1_fe_set_b32_limit (& fe2 , b32 ));
3018
- CHECK (secp256k1_fe_equal_var (& fe , & fe2 ));
3017
+ CHECK (secp256k1_fe_equal (& fe , & fe2 ));
3019
3018
secp256k1_fe_from_storage (& fe2 , & fes );
3020
- CHECK (secp256k1_fe_equal_var (& fe , & fe2 ));
3019
+ CHECK (secp256k1_fe_equal (& fe , & fe2 ));
3021
3020
/* Check conversion from fe. */
3022
3021
secp256k1_fe_get_b32 (b322 , & fe );
3023
3022
CHECK (secp256k1_memcmp_var (b322 , b32 , 32 ) == 0 );
@@ -3174,7 +3173,7 @@ static void run_field_misc(void) {
3174
3173
CHECK (check_fe_equal (& q , & z ));
3175
3174
/* Test the fe equality and comparison operations. */
3176
3175
CHECK (secp256k1_fe_cmp_var (& x , & x ) == 0 );
3177
- CHECK (secp256k1_fe_equal_var (& x , & x ));
3176
+ CHECK (secp256k1_fe_equal (& x , & x ));
3178
3177
z = x ;
3179
3178
secp256k1_fe_add (& z ,& y );
3180
3179
/* Test fe conditional move; z is not normalized here. */
@@ -3199,7 +3198,7 @@ static void run_field_misc(void) {
3199
3198
q = z ;
3200
3199
secp256k1_fe_normalize_var (& x );
3201
3200
secp256k1_fe_normalize_var (& z );
3202
- CHECK (!secp256k1_fe_equal_var (& x , & z ));
3201
+ CHECK (!secp256k1_fe_equal (& x , & z ));
3203
3202
secp256k1_fe_normalize_var (& q );
3204
3203
secp256k1_fe_cmov (& q , & z , (i & 1 ));
3205
3204
#ifdef VERIFY
@@ -3704,8 +3703,8 @@ static void ge_equals_ge(const secp256k1_ge *a, const secp256k1_ge *b) {
3704
3703
if (a -> infinity ) {
3705
3704
return ;
3706
3705
}
3707
- CHECK (secp256k1_fe_equal_var (& a -> x , & b -> x ));
3708
- CHECK (secp256k1_fe_equal_var (& a -> y , & b -> y ));
3706
+ CHECK (secp256k1_fe_equal (& a -> x , & b -> x ));
3707
+ CHECK (secp256k1_fe_equal (& a -> y , & b -> y ));
3709
3708
}
3710
3709
3711
3710
/* This compares jacobian points including their Z, not just their geometric meaning. */
@@ -3740,11 +3739,11 @@ static void ge_equals_gej(const secp256k1_ge *a, const secp256k1_gej *b) {
3740
3739
/* Check a.x * b.z^2 == b.x && a.y * b.z^3 == b.y, to avoid inverses. */
3741
3740
secp256k1_fe_sqr (& z2s , & b -> z );
3742
3741
secp256k1_fe_mul (& u1 , & a -> x , & z2s );
3743
- u2 = b -> x ; secp256k1_fe_normalize_weak ( & u2 );
3742
+ u2 = b -> x ;
3744
3743
secp256k1_fe_mul (& s1 , & a -> y , & z2s ); secp256k1_fe_mul (& s1 , & s1 , & b -> z );
3745
- s2 = b -> y ; secp256k1_fe_normalize_weak ( & s2 );
3746
- CHECK (secp256k1_fe_equal_var (& u1 , & u2 ));
3747
- CHECK (secp256k1_fe_equal_var (& s1 , & s2 ));
3744
+ s2 = b -> y ;
3745
+ CHECK (secp256k1_fe_equal (& u1 , & u2 ));
3746
+ CHECK (secp256k1_fe_equal (& s1 , & s2 ));
3748
3747
}
3749
3748
3750
3749
static void test_ge (void ) {
@@ -3812,7 +3811,7 @@ static void test_ge(void) {
3812
3811
/* Check Z ratio. */
3813
3812
if (!secp256k1_gej_is_infinity (& gej [i1 ]) && !secp256k1_gej_is_infinity (& refj )) {
3814
3813
secp256k1_fe zrz ; secp256k1_fe_mul (& zrz , & zr , & gej [i1 ].z );
3815
- CHECK (secp256k1_fe_equal_var (& zrz , & refj .z ));
3814
+ CHECK (secp256k1_fe_equal (& zrz , & refj .z ));
3816
3815
}
3817
3816
secp256k1_ge_set_gej_var (& ref , & refj );
3818
3817
@@ -3821,7 +3820,7 @@ static void test_ge(void) {
3821
3820
ge_equals_gej (& ref , & resj );
3822
3821
if (!secp256k1_gej_is_infinity (& gej [i1 ]) && !secp256k1_gej_is_infinity (& resj )) {
3823
3822
secp256k1_fe zrz ; secp256k1_fe_mul (& zrz , & zr , & gej [i1 ].z );
3824
- CHECK (secp256k1_fe_equal_var (& zrz , & resj .z ));
3823
+ CHECK (secp256k1_fe_equal (& zrz , & resj .z ));
3825
3824
}
3826
3825
3827
3826
/* Test gej + ge (var, with additional Z factor). */
@@ -3850,7 +3849,7 @@ static void test_ge(void) {
3850
3849
ge_equals_gej (& ref , & resj );
3851
3850
/* Check Z ratio. */
3852
3851
secp256k1_fe_mul (& zr2 , & zr2 , & gej [i1 ].z );
3853
- CHECK (secp256k1_fe_equal_var (& zr2 , & resj .z ));
3852
+ CHECK (secp256k1_fe_equal (& zr2 , & resj .z ));
3854
3853
/* Normal doubling. */
3855
3854
secp256k1_gej_double_var (& resj , & gej [i2 ], NULL );
3856
3855
ge_equals_gej (& ref , & resj );
@@ -3933,7 +3932,7 @@ static void test_ge(void) {
3933
3932
ret_set_xo = secp256k1_ge_set_xo_var (& q , & r , 0 );
3934
3933
CHECK (ret_on_curve == ret_frac_on_curve );
3935
3934
CHECK (ret_on_curve == ret_set_xo );
3936
- if (ret_set_xo ) CHECK (secp256k1_fe_equal_var (& r , & q .x ));
3935
+ if (ret_set_xo ) CHECK (secp256k1_fe_equal (& r , & q .x ));
3937
3936
}
3938
3937
3939
3938
/* Test batch gej -> ge conversion with many infinities. */
@@ -4173,8 +4172,8 @@ static void test_group_decompress(const secp256k1_fe* x) {
4173
4172
CHECK (!ge_odd .infinity );
4174
4173
4175
4174
/* Check that the x coordinates check out. */
4176
- CHECK (secp256k1_fe_equal_var (& ge_even .x , x ));
4177
- CHECK (secp256k1_fe_equal_var (& ge_odd .x , x ));
4175
+ CHECK (secp256k1_fe_equal (& ge_even .x , x ));
4176
+ CHECK (secp256k1_fe_equal (& ge_odd .x , x ));
4178
4177
4179
4178
/* Check odd/even Y in ge_odd, ge_even. */
4180
4179
CHECK (secp256k1_fe_is_odd (& ge_odd .y ));
@@ -4226,18 +4225,18 @@ static void test_pre_g_table(const secp256k1_ge_storage * pre_g, size_t n) {
4226
4225
secp256k1_ge_from_storage (& q , & pre_g [i ]);
4227
4226
CHECK (secp256k1_ge_is_valid_var (& q ));
4228
4227
4229
- secp256k1_fe_negate (& dqx , & q .x , 1 ); secp256k1_fe_add (& dqx , & gg .x ); secp256k1_fe_normalize_weak ( & dqx );
4230
- dqy = q .y ; secp256k1_fe_add (& dqy , & gg .y ); secp256k1_fe_normalize_weak ( & dqy );
4228
+ secp256k1_fe_negate (& dqx , & q .x , 1 ); secp256k1_fe_add (& dqx , & gg .x );
4229
+ dqy = q .y ; secp256k1_fe_add (& dqy , & gg .y );
4231
4230
/* Check that -q is not equal to gg */
4232
4231
CHECK (!secp256k1_fe_normalizes_to_zero_var (& dqx ) || !secp256k1_fe_normalizes_to_zero_var (& dqy ));
4233
4232
4234
4233
/* Check that -q is not equal to p */
4235
- CHECK (!secp256k1_fe_equal_var (& dpx , & dqx ) || !secp256k1_fe_equal_var (& dpy , & dqy ));
4234
+ CHECK (!secp256k1_fe_equal (& dpx , & dqx ) || !secp256k1_fe_equal (& dpy , & dqy ));
4236
4235
4237
4236
/* Check that p, -q and gg are colinear */
4238
4237
secp256k1_fe_mul (& dpx , & dpx , & dqy );
4239
4238
secp256k1_fe_mul (& dpy , & dpy , & dqx );
4240
- CHECK (secp256k1_fe_equal_var (& dpx , & dpy ));
4239
+ CHECK (secp256k1_fe_equal (& dpx , & dpy ));
4241
4240
4242
4241
p = q ;
4243
4242
}
@@ -4456,7 +4455,7 @@ static void run_point_times_order(void) {
4456
4455
secp256k1_fe_sqr (& x , & x );
4457
4456
}
4458
4457
secp256k1_fe_normalize_var (& x );
4459
- CHECK (secp256k1_fe_equal_var (& x , & xr ));
4458
+ CHECK (secp256k1_fe_equal (& x , & xr ));
4460
4459
}
4461
4460
4462
4461
static void ecmult_const_random_mult (void ) {
0 commit comments