diff options
author | Özgür Kesim <oec@codeblau.de> | 2024-03-21 19:02:20 +0100 |
---|---|---|
committer | Özgür Kesim <oec@codeblau.de> | 2024-03-21 19:02:20 +0100 |
commit | 989d09c8511eb10f2af06977d210deff39b6ff9e (patch) | |
tree | d360f2e3aa06d0e6dc2eaaac62274ca602d8821c /veto/veto_test.go | |
parent | 458f9b7172148a272b23d61747f0758bf21dbf1f (diff) |
veto, curve: Added an abstraction layer for elliptic curves
This will allow to easily swap various curves and implementations, for benchmarking, f.e.
Diffstat (limited to 'veto/veto_test.go')
-rw-r--r-- | veto/veto_test.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/veto/veto_test.go b/veto/veto_test.go index 847c7a0..a5f4fb2 100644 --- a/veto/veto_test.go +++ b/veto/veto_test.go @@ -3,6 +3,8 @@ package veto import ( "math/rand" "testing" + + "kesim.org/seal/curve" ) func TestVoteGeneration(t *testing.T) { @@ -28,7 +30,7 @@ func TestRound2NoVeto(t *testing.T) { var ( vs = []*Vote{} cs = []*Commitment{} - gcys = []*point{} + gcys = []*curve.Curve25519Point{} num = 100 ) for i := range num { @@ -63,7 +65,7 @@ func TestRound2WithVeto(t *testing.T) { var ( vs = []*Vote{} cs = []*Commitment{} - gcys = []*point{} + gcys = []*curve.Curve25519Point{} num = 100 index = int(rand.Int31n(int32(num))) ) @@ -72,6 +74,9 @@ func TestRound2WithVeto(t *testing.T) { if e != nil { t.Fatalf("unexpected error: %v", e) } + if vote.veto { + t.Logf("Veto for index no. %d\n", i) + } com := vote.Commitment() if !com.VerifyProofs() { t.Fatalf("Proofs not correct for %d! %+v", i, com) @@ -82,10 +87,10 @@ func TestRound2WithVeto(t *testing.T) { for i := range num { gcy, e := vs[i].Round2(cs) - t.Logf("gcy: %v, e: %v", gcy, e) if e != nil { - t.Fatalf("Error calculating Round2: %v", e) + t.Fatalf("Error calculating Round2 for [%d]: %v", i, e) } + t.Logf("gcy[%d]: %v", i, gcy) gcys = append(gcys, gcy) } |