File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
libff/algebra/curves/alt_bn128 Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,10 @@ alt_bn128_G1 alt_bn128_G1::operator+(const alt_bn128_G1 &other) const
179
179
return this ->dbl ();
180
180
}
181
181
182
+ #ifdef PROFILE_OP_COUNTS
183
+ this ->add_cnt ++;
184
+ #endif
185
+
182
186
// rest of add case
183
187
alt_bn128_Fq H = U2 - U1; // H = U2-U1
184
188
alt_bn128_Fq S2_minus_S1 = S2-S1;
@@ -259,10 +263,9 @@ alt_bn128_G1 alt_bn128_G1::mixed_add(const alt_bn128_G1 &other) const
259
263
#ifdef PROFILE_OP_COUNTS
260
264
this ->add_cnt ++;
261
265
#endif
262
-
263
266
264
267
alt_bn128_Fq H = U2-(this ->X ); // H = U2-X1
265
- alt_bn128_Fq HH = H.squared () ; // HH = H& 2
268
+ alt_bn128_Fq HH = H.squared () ; // HH = H^ 2
266
269
alt_bn128_Fq I = HH+HH; // I = 4*HH
267
270
I = I + I;
268
271
alt_bn128_Fq J = H*I; // J = H*I
Original file line number Diff line number Diff line change @@ -189,6 +189,10 @@ alt_bn128_G2 alt_bn128_G2::operator+(const alt_bn128_G2 &other) const
189
189
return this ->dbl ();
190
190
}
191
191
192
+ #ifdef PROFILE_OP_COUNTS
193
+ this ->add_cnt ++;
194
+ #endif
195
+
192
196
// rest of add case
193
197
alt_bn128_Fq2 H = U2 - U1; // H = U2-U1
194
198
alt_bn128_Fq2 S2_minus_S1 = S2-S1;
@@ -271,7 +275,7 @@ alt_bn128_G2 alt_bn128_G2::mixed_add(const alt_bn128_G2 &other) const
271
275
#endif
272
276
273
277
alt_bn128_Fq2 H = U2-(this ->X ); // H = U2-X1
274
- alt_bn128_Fq2 HH = H.squared () ; // HH = H& 2
278
+ alt_bn128_Fq2 HH = H.squared () ; // HH = H^ 2
275
279
alt_bn128_Fq2 I = HH+HH; // I = 4*HH
276
280
I = I + I;
277
281
alt_bn128_Fq2 J = H*I; // J = H*I
You can’t perform that action at this time.
0 commit comments