We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1102b1 commit c9da1baCopy full SHA for c9da1ba
src/field.h
@@ -32,6 +32,8 @@
32
#error "Please select wide multiplication implementation"
33
#endif
34
35
+static const secp256k1_fe secp256k1_fe_one = SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 1);
36
+
37
/** Normalize a field element. This brings the field element to a canonical representation, reduces
38
* its magnitude to 1, and reduces it modulo field size `p`.
39
*/
src/field_impl.h
@@ -135,6 +135,4 @@ static int secp256k1_fe_sqrt(secp256k1_fe *r, const secp256k1_fe *a) {
135
return secp256k1_fe_equal(&t1, a);
136
}
137
138
-static const secp256k1_fe secp256k1_fe_one = SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 1);
139
-
140
#endif /* SECP256K1_FIELD_IMPL_H */
src/group_impl.h
@@ -494,7 +494,6 @@ static void secp256k1_gej_add_zinv_var(secp256k1_gej *r, const secp256k1_gej *a,
494
495
static void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b) {
496
/* Operations: 7 mul, 5 sqr, 4 normalize, 21 mul_int/add/negate/cmov */
497
- static const secp256k1_fe fe_1 = SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 1);
498
secp256k1_fe zz, u1, u2, s1, s2, t, tt, m, n, q, rr;
499
secp256k1_fe m_alt, rr_alt;
500
int infinity, degenerate;
@@ -610,7 +609,7 @@ static void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const
610
609
/** In case a->infinity == 1, replace r with (b->x, b->y, 1). */
611
secp256k1_fe_cmov(&r->x, &b->x, a->infinity);
612
secp256k1_fe_cmov(&r->y, &b->y, a->infinity);
613
- secp256k1_fe_cmov(&r->z, &fe_1, a->infinity);
+ secp256k1_fe_cmov(&r->z, &secp256k1_fe_one, a->infinity);
614
r->infinity = infinity;
615
616
0 commit comments