mirror of
https://github.com/arnaucube/go-iden3-crypto.git
synced 2026-02-07 03:26:39 +01:00
Faster ff arithmetics (regenerated code with the newest goff) (#43)
This commit is contained in:
committed by
GitHub
parent
f597e20569
commit
69354ae29c
@@ -95,20 +95,20 @@ func (p *PointProjective) Add(q *PointProjective, o *PointProjective) *PointProj
|
||||
c := ff.NewElement().Mul(q.X, o.X)
|
||||
d := ff.NewElement().Mul(q.Y, o.Y)
|
||||
e := ff.NewElement().Mul(Dff, c)
|
||||
e.MulAssign(d)
|
||||
e.Mul(e, d)
|
||||
f := ff.NewElement().Sub(b, e)
|
||||
g := ff.NewElement().Add(b, e)
|
||||
x1y1 := ff.NewElement().Add(q.X, q.Y)
|
||||
x2y2 := ff.NewElement().Add(o.X, o.Y)
|
||||
x3 := ff.NewElement().Mul(x1y1, x2y2)
|
||||
x3.SubAssign(c)
|
||||
x3.SubAssign(d)
|
||||
x3.MulAssign(a)
|
||||
x3.MulAssign(f)
|
||||
x3.Sub(x3, c)
|
||||
x3.Sub(x3, d)
|
||||
x3.Mul(x3, a)
|
||||
x3.Mul(x3, f)
|
||||
ac := ff.NewElement().Mul(Aff, c)
|
||||
y3 := ff.NewElement().Sub(d, ac)
|
||||
y3.MulAssign(a)
|
||||
y3.MulAssign(g)
|
||||
y3.Mul(y3, a)
|
||||
y3.Mul(y3, g)
|
||||
z3 := ff.NewElement().Mul(f, g)
|
||||
|
||||
p.X = x3
|
||||
|
||||
Reference in New Issue
Block a user