diff options
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 |
commit | d0560b68aec9528181ba57f24f4eaa35401246bb (patch) | |
tree | edb543dd39f50b0ae819e61bc9327b45cfb2ce79 /vote/vote_test.go | |
parent | e92c9886af82d5d9bc64b715677588e2643271bd (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.go | 19 |
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) + } +} |