diff options
Diffstat (limited to 'nizk/commit/commit_test.go')
-rw-r--r-- | nizk/commit/commit_test.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/nizk/commit/commit_test.go b/nizk/commit/commit_test.go index 4ea5964..111ab68 100644 --- a/nizk/commit/commit_test.go +++ b/nizk/commit/commit_test.go @@ -10,18 +10,18 @@ func TestStatement(t *testing.T) { id := Curve.RandomScalar() Id := G.Exp(id) - st1, st2 := NewStatement(true), NewStatement(false) - c1, c2 := st1.Commit(Id), st2.Commit(Id) - if !c1.Verify() { + st1, st2 := NewBid(true), NewBid(false) + c1, p1 := st1.Commit(Id) + c2, p2 := st2.Commit(Id) + if !c1.Verify(p1) { t.Fatal("Could not verify st1 with c1, plus=true case") } - if !c2.Verify() { + if !c2.Verify(p2) { t.Fatal("Could not verify st2 with c2, plus=false case") } // Use the wrong proof - c2.Proof = c1.Proof - if c2.Verify() { + if c2.Verify(p1) { t.Fatal("Verify with wrong proof should have failed!") } } @@ -31,18 +31,18 @@ func TestStatementFromScalar(t *testing.T) { Id := G.Exp(id) - st1, st2 := NewStatementFromScalars(true, α, β), NewStatementFromScalars(false, α, β) - c1, c2 := st1.Commit(Id), st2.Commit(Id) - if !c1.Verify() { + st1, st2 := NewBidFromScalars(true, α, β), NewBidFromScalars(false, α, β) + c1, p1 := st1.Commit(Id) + c2, p2 := st2.Commit(Id) + if !c1.Verify(p1) { t.Fatal("Could not verify st1 with c1, plus=true case") } - if !c2.Verify() { + if !c2.Verify(p2) { t.Fatal("Could not verify st2 with c2, plus=false case") } // Use the wrong proof - c2.Proof = c1.Proof - if c2.Verify() { + if c2.Verify(p1) { t.Fatal("Verify with wrong proof should have failed!") } } |