7 #ifndef SECP256K1_FIELD_IMPL_H 8 #define SECP256K1_FIELD_IMPL_H 12 #if defined(SECP256K1_WIDEMUL_INT128) 14 #elif defined(SECP256K1_WIDEMUL_INT64) 17 #error "Please select wide multiplication implementation" 22 secp256k1_fe_negate(&na,
a, 1);
23 secp256k1_fe_add(&na, b);
24 return secp256k1_fe_normalizes_to_zero(&na);
29 secp256k1_fe_negate(&na,
a, 1);
30 secp256k1_fe_add(&na, b);
31 return secp256k1_fe_normalizes_to_zero_var(&na);
44 secp256k1_fe x2, x3, x6, x9, x11, x22, x44, x88, x176, x220, x223,
t1;
54 secp256k1_fe_sqr(&x2,
a);
55 secp256k1_fe_mul(&x2, &x2,
a);
57 secp256k1_fe_sqr(&x3, &x2);
58 secp256k1_fe_mul(&x3, &x3,
a);
62 secp256k1_fe_sqr(&x6, &x6);
64 secp256k1_fe_mul(&x6, &x6, &x3);
68 secp256k1_fe_sqr(&x9, &x9);
70 secp256k1_fe_mul(&x9, &x9, &x3);
74 secp256k1_fe_sqr(&x11, &x11);
76 secp256k1_fe_mul(&x11, &x11, &x2);
79 for (j=0; j<11; j++) {
80 secp256k1_fe_sqr(&x22, &x22);
82 secp256k1_fe_mul(&x22, &x22, &x11);
85 for (j=0; j<22; j++) {
86 secp256k1_fe_sqr(&x44, &x44);
88 secp256k1_fe_mul(&x44, &x44, &x22);
91 for (j=0; j<44; j++) {
92 secp256k1_fe_sqr(&x88, &x88);
94 secp256k1_fe_mul(&x88, &x88, &x44);
97 for (j=0; j<88; j++) {
98 secp256k1_fe_sqr(&x176, &x176);
100 secp256k1_fe_mul(&x176, &x176, &x88);
103 for (j=0; j<44; j++) {
104 secp256k1_fe_sqr(&x220, &x220);
106 secp256k1_fe_mul(&x220, &x220, &x44);
109 for (j=0; j<3; j++) {
110 secp256k1_fe_sqr(&x223, &x223);
112 secp256k1_fe_mul(&x223, &x223, &x3);
117 for (j=0; j<23; j++) {
118 secp256k1_fe_sqr(&
t1, &
t1);
120 secp256k1_fe_mul(&
t1, &
t1, &x22);
121 for (j=0; j<6; j++) {
122 secp256k1_fe_sqr(&
t1, &
t1);
124 secp256k1_fe_mul(&
t1, &
t1, &x2);
125 secp256k1_fe_sqr(&
t1, &
t1);
126 secp256k1_fe_sqr(r, &
t1);
130 secp256k1_fe_sqr(&
t1, r);
131 return secp256k1_fe_equal(&
t1,
a);
#define VERIFY_CHECK(cond)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a