Skip to content

Commit 58c3a22

Browse files
committed
minor comments
1 parent abaf225 commit 58c3a22

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

addchain/t_tpl

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Function generated by {{ .Meta.Name }}. DO NOT EDIT.
2-
// Computes FQ12 exponentiated by -t = -4965661367192848881
32
fn addchain_exp_by_neg_t(x: Fq12, field_nz: NonZero<u256>) -> Fq12 {
43
internal::revoke_ap_tracking();
54
// Inversion computation is derived from the addition chain:

src/curve/groups.cairo

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ impl AffineOps<
3232
#[inline(always)]
3333
fn pt_on_slope(self: @Affine<T>, slope: T, x2: T) -> Affine<T> {
3434
let Affine { x: sx, y: sy } = *self;
35-
// x = λ^2 - sx - x2
35+
// x = λ^2 - x1 - x2
3636
let x = slope.sqr() - sx - x2;
37-
// y = λ(sx - x) - sy
37+
// y = λ(x1 - x) - y1
3838
let y = slope * (sx - x) - sy;
3939
Affine { x, y }
4040
}
4141

4242
fn chord(self: @Affine<T>, rhs: Affine<T>) -> T {
4343
let Affine { x: x1, y: y1 } = *self;
4444
let Affine { x: x2, y: y2 } = rhs;
45+
// λ = (y2-y1) / (x2-x1)
4546
(y2 - y1) / (x2 - x1)
4647
}
4748

src/fields/fq_12_expo.cairo

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ fn X3(a: (u512, u512)) -> (u512, u512) {
4545
a + a + a
4646
}
4747

48+
// Computes FQ12 exponentiated by -t = -4965661367192848881 = 0x44e992b44a6909f1
4849
// Function generated by addchain. DO NOT EDIT.
49-
// Computes FQ12 exponentiated by t = 4965661367192848881
5050
#[inline(always)]
5151
fn addchain_exp_by_neg_t(x: Fq12, field_nz: NonZero<u256>) -> Fq12 {
5252
internal::revoke_ap_tracking();

0 commit comments

Comments
 (0)