aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bn256
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-05-24 21:40:02 +0800
committerFelix Lange <fjl@twurst.com>2017-05-24 21:40:26 +0800
commit069cb661c3587a0ff5f74c85775c2849a400cb9c (patch)
treebbdb5cfa2fea43249f04bc018d19cbad3a31b93c /crypto/bn256
parente1e87d8b1aebe88354e2f64ffd031709524522e4 (diff)
downloaddexon-069cb661c3587a0ff5f74c85775c2849a400cb9c.tar
dexon-069cb661c3587a0ff5f74c85775c2849a400cb9c.tar.gz
dexon-069cb661c3587a0ff5f74c85775c2849a400cb9c.tar.bz2
dexon-069cb661c3587a0ff5f74c85775c2849a400cb9c.tar.lz
dexon-069cb661c3587a0ff5f74c85775c2849a400cb9c.tar.xz
dexon-069cb661c3587a0ff5f74c85775c2849a400cb9c.tar.zst
dexon-069cb661c3587a0ff5f74c85775c2849a400cb9c.zip
crypto/bn256: fix go vet false positive
Also add the package to the license tool ignore list.
Diffstat (limited to 'crypto/bn256')
-rw-r--r--crypto/bn256/curve.go10
-rw-r--r--crypto/bn256/gfp6.go12
-rw-r--r--crypto/bn256/optate.go8
-rw-r--r--crypto/bn256/twist.go8
4 files changed, 19 insertions, 19 deletions
diff --git a/crypto/bn256/curve.go b/crypto/bn256/curve.go
index 93f858def..233b1f252 100644
--- a/crypto/bn256/curve.go
+++ b/crypto/bn256/curve.go
@@ -186,14 +186,14 @@ func (c *curvePoint) Double(a *curvePoint, pool *bnPool) {
A.Mod(A, P)
B := pool.Get().Mul(a.y, a.y)
B.Mod(B, P)
- C := pool.Get().Mul(B, B)
- C.Mod(C, P)
+ C_ := pool.Get().Mul(B, B)
+ C_.Mod(C_, P)
t := pool.Get().Add(a.x, B)
t2 := pool.Get().Mul(t, t)
t2.Mod(t2, P)
t.Sub(t2, A)
- t2.Sub(t, C)
+ t2.Sub(t, C_)
d := pool.Get().Add(t2, t2)
t.Add(A, A)
e := pool.Get().Add(t, A)
@@ -203,7 +203,7 @@ func (c *curvePoint) Double(a *curvePoint, pool *bnPool) {
t.Add(d, d)
c.x.Sub(f, t)
- t.Add(C, C)
+ t.Add(C_, C_)
t2.Add(t, t)
t.Add(t2, t2)
c.y.Sub(d, c.x)
@@ -217,7 +217,7 @@ func (c *curvePoint) Double(a *curvePoint, pool *bnPool) {
pool.Put(A)
pool.Put(B)
- pool.Put(C)
+ pool.Put(C_)
pool.Put(t)
pool.Put(t2)
pool.Put(d)
diff --git a/crypto/bn256/gfp6.go b/crypto/bn256/gfp6.go
index 8fd777d52..218856617 100644
--- a/crypto/bn256/gfp6.go
+++ b/crypto/bn256/gfp6.go
@@ -266,13 +266,13 @@ func (e *gfP6) Invert(a *gfP6, pool *bnPool) *gfP6 {
t1.Mul(a.y, a.z, pool)
B.Sub(B, t1)
- C := newGFp2(pool)
- C.Square(a.y, pool)
+ C_ := newGFp2(pool)
+ C_.Square(a.y, pool)
t1.Mul(a.x, a.z, pool)
- C.Sub(C, t1)
+ C_.Sub(C_, t1)
F := newGFp2(pool)
- F.Mul(C, a.y, pool)
+ F.Mul(C_, a.y, pool)
F.MulXi(F, pool)
t1.Mul(A, a.z, pool)
F.Add(F, t1)
@@ -282,14 +282,14 @@ func (e *gfP6) Invert(a *gfP6, pool *bnPool) *gfP6 {
F.Invert(F, pool)
- e.x.Mul(C, F, pool)
+ e.x.Mul(C_, F, pool)
e.y.Mul(B, F, pool)
e.z.Mul(A, F, pool)
t1.Put(pool)
A.Put(pool)
B.Put(pool)
- C.Put(pool)
+ C_.Put(pool)
F.Put(pool)
return e
diff --git a/crypto/bn256/optate.go b/crypto/bn256/optate.go
index 24e0bbc13..68716b62b 100644
--- a/crypto/bn256/optate.go
+++ b/crypto/bn256/optate.go
@@ -88,12 +88,12 @@ func lineFunctionDouble(r *twistPoint, q *curvePoint, pool *bnPool) (a, b, c *gf
A := newGFp2(pool).Square(r.x, pool)
B := newGFp2(pool).Square(r.y, pool)
- C := newGFp2(pool).Square(B, pool)
+ C_ := newGFp2(pool).Square(B, pool)
D := newGFp2(pool).Add(r.x, B)
D.Square(D, pool)
D.Sub(D, A)
- D.Sub(D, C)
+ D.Sub(D, C_)
D.Add(D, D)
E := newGFp2(pool).Add(A, A)
@@ -112,7 +112,7 @@ func lineFunctionDouble(r *twistPoint, q *curvePoint, pool *bnPool) (a, b, c *gf
rOut.y.Sub(D, rOut.x)
rOut.y.Mul(rOut.y, E, pool)
- t := newGFp2(pool).Add(C, C)
+ t := newGFp2(pool).Add(C_, C_)
t.Add(t, t)
t.Add(t, t)
rOut.y.Sub(rOut.y, t)
@@ -142,7 +142,7 @@ func lineFunctionDouble(r *twistPoint, q *curvePoint, pool *bnPool) (a, b, c *gf
A.Put(pool)
B.Put(pool)
- C.Put(pool)
+ C_.Put(pool)
D.Put(pool)
E.Put(pool)
G.Put(pool)
diff --git a/crypto/bn256/twist.go b/crypto/bn256/twist.go
index 1e052456e..95b966e2e 100644
--- a/crypto/bn256/twist.go
+++ b/crypto/bn256/twist.go
@@ -165,12 +165,12 @@ func (c *twistPoint) Double(a *twistPoint, pool *bnPool) {
// See http://hyperelliptic.org/EFD/g1p/auto-code/shortw/jacobian-0/doubling/dbl-2009-l.op3
A := newGFp2(pool).Square(a.x, pool)
B := newGFp2(pool).Square(a.y, pool)
- C := newGFp2(pool).Square(B, pool)
+ C_ := newGFp2(pool).Square(B, pool)
t := newGFp2(pool).Add(a.x, B)
t2 := newGFp2(pool).Square(t, pool)
t.Sub(t2, A)
- t2.Sub(t, C)
+ t2.Sub(t, C_)
d := newGFp2(pool).Add(t2, t2)
t.Add(A, A)
e := newGFp2(pool).Add(t, A)
@@ -179,7 +179,7 @@ func (c *twistPoint) Double(a *twistPoint, pool *bnPool) {
t.Add(d, d)
c.x.Sub(f, t)
- t.Add(C, C)
+ t.Add(C_, C_)
t2.Add(t, t)
t.Add(t2, t2)
c.y.Sub(d, c.x)
@@ -191,7 +191,7 @@ func (c *twistPoint) Double(a *twistPoint, pool *bnPool) {
A.Put(pool)
B.Put(pool)
- C.Put(pool)
+ C_.Put(pool)
t.Put(pool)
t2.Put(pool)
d.Put(pool)