diff options
Diffstat (limited to 'veto')
-rw-r--r-- | veto/veto.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/veto/veto.go b/veto/veto.go index 99fe7f9..9ecf13f 100644 --- a/veto/veto.go +++ b/veto/veto.go @@ -49,8 +49,8 @@ type Commitment struct { // // Verification of the signature is by comparing V =?= g^r * g^(x*h) type Proof struct { - PV *Point `json:"V"` - Sr *Scalar `json:"r"` + V *Point `json:"V"` + R *Scalar `json:"r"` } // Generates the proof, aka Schnorr signature, for given priv and i. @@ -70,13 +70,13 @@ func proof(x *Scalar, id *Point) (pr *Proof, e error) { } // calculate g^v - pr.PV = Curve.Exp(v) + pr.V = Curve.Exp(v) // calculate g^x gx := Curve.Exp(x) // calculate h := H(g, g^v, g^x, i) - h, e := hash(pr.PV, gx, id) + h, e := hash(pr.V, gx, id) if e != nil { return nil, e } @@ -84,7 +84,7 @@ func proof(x *Scalar, id *Point) (pr *Proof, e error) { // Calculate r := v - x*h xh := x.Mul(h) r := v.Sub(xh) - pr.Sr = r + pr.R = r return pr, nil } @@ -137,8 +137,8 @@ func verifyProof(V *Point, Gx *Point, r *Scalar, id *Point) (ok bool) { // Verify verifies the proofs for both, g^x and g^r func (c *Commitment) VerifyProofs() (ok bool) { - okX := verifyProof(c.Proofs.X.PV, c.Points.X, c.Proofs.X.Sr, c.Id) - okR := verifyProof(c.Proofs.R.PV, c.Points.R, c.Proofs.R.Sr, c.Id) + okX := verifyProof(c.Proofs.X.V, c.Points.X, c.Proofs.X.R, c.Id) + okR := verifyProof(c.Proofs.R.V, c.Points.R, c.Proofs.R.R, c.Id) return okX && okR } |