aboutsummaryrefslogtreecommitdiff
path: root/vote/vote_test.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@kesim.org>2024-03-19 21:08:48 +0100
committerÖzgür Kesim <oec@kesim.org>2024-03-19 21:08:48 +0100
commitd0560b68aec9528181ba57f24f4eaa35401246bb (patch)
treeedb543dd39f50b0ae819e61bc9327b45cfb2ce79 /vote/vote_test.go
parente92c9886af82d5d9bc64b715677588e2643271bd (diff)
vote: proof generation and verification added
Generation of a Commitment is implemented, together with the generation and verification of proofs, i.e. their Schnorr's signatures
Diffstat (limited to 'vote/vote_test.go')
-rw-r--r--vote/vote_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/vote/vote_test.go b/vote/vote_test.go
new file mode 100644
index 0000000..7a00ee3
--- /dev/null
+++ b/vote/vote_test.go
@@ -0,0 +1,19 @@
+package vote
+
+import (
+ "testing"
+)
+
+func TestRound(t *testing.T) {
+ v, e := newVoteWithRand(false, 0, nil)
+
+ if e != nil {
+ t.Fatalf("unexpected error: %v", e)
+ }
+ if v.bit {
+ t.Fatal("expected vote false, but got true")
+ }
+ if !v.VerifyProofs() {
+ t.Fatalf("Proofs not correct! %+v", v)
+ }
+}