aboutsummaryrefslogtreecommitdiff
path: root/nizk/stage2/stage2.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2024-04-09 19:21:24 +0200
committerÖzgür Kesim <oec@codeblau.de>2024-04-09 19:21:24 +0200
commitf28109fc32c9068cf57619ccd7ee05a8da8e5d24 (patch)
tree80e75d0be59f8fbdee8d1487c4cfb61bc1b0eae7 /nizk/stage2/stage2.go
parent03d3f676c36ccd36bb201d317bd2350ada6ba451 (diff)
nizk: use Bytes interface for abstraction
Diffstat (limited to 'nizk/stage2/stage2.go')
-rw-r--r--nizk/stage2/stage2.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/nizk/stage2/stage2.go b/nizk/stage2/stage2.go
index 85d4b10..a17000f 100644
--- a/nizk/stage2/stage2.go
+++ b/nizk/stage2/stage2.go
@@ -113,9 +113,9 @@ type Proof struct {
func (s *Statement) Proof() *Proof {
var (
- e1, e1_ [3]*Point
- e2, e2_ [3]*Point
- e3, e3_ [2]*Point
+ e1, e1_ [3]Bytes
+ e2, e2_ [3]Bytes
+ e3, e3_ [2]Bytes
r1, r2 [3]*Scalar
r3 [2]*Scalar
@@ -202,7 +202,7 @@ func (s *Statement) Proof() *Proof {
panic("not possible")
}
- points := []*Point{G, s.A, s.B, s.C, s.R, s.X, s.Y, s.Z, s.R_, s.X_, s.Y_, s.Z_}
+ points := []Bytes{G, s.A, s.B, s.C, s.R, s.X, s.Y, s.Z, s.R_, s.X_, s.Y_, s.Z_}
points = append(points, e1[:]...)
points = append(points, e2[:]...)
points = append(points, e3[:]...)
@@ -271,9 +271,9 @@ func (s *Statement) Proof() *Proof {
func (c *Commitment) Verify(p *Proof) bool {
var (
- e1, e1_ [3]*Point
- e2, e2_ [3]*Point
- e3, e3_ [2]*Point
+ e1, e1_ [3]Bytes
+ e2, e2_ [3]Bytes
+ e3, e3_ [2]Bytes
)
e1[0] = G.Exp(p.R1[0]).Mul(c.X.Exp(p.Ch[0]))
e1[1] = G.Exp(p.R1[1]).Mul(c.X_.Exp(p.Ch[0]))
@@ -297,7 +297,7 @@ func (c *Commitment) Verify(p *Proof) bool {
e3_[0] = c.Y.Exp(p.R3[0]).Mul(c.Z.Exp(p.Ch[2]))
e3_[1] = c.Y_.Exp(p.R3[1]).Mul(c.Z_.Exp(p.Ch[2]))
- points := []*Point{G, c.A, c.B, c.C, c.R, c.X, c.Y, c.Z, c.R_, c.X_, c.Y_, c.Z_}
+ points := []Bytes{G, c.A, c.B, c.C, c.R, c.X, c.Y, c.Z, c.R_, c.X_, c.Y_, c.Z_}
points = append(points, e1[:]...)
points = append(points, e2[:]...)
points = append(points, e3[:]...)