diff options
Diffstat (limited to 'nizk/vickrey_test.go')
-rw-r--r-- | nizk/vickrey_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nizk/vickrey_test.go b/nizk/vickrey_test.go index 282619d..dd2846a 100644 --- a/nizk/vickrey_test.go +++ b/nizk/vickrey_test.go @@ -42,7 +42,7 @@ func runVickrey(n int, bitlength int, tb testing.TB) { winner := -1 result := 0 - checkWinner := func(Z *Point, i int, idx int) { + isWinner := func(Z *Point, i int, idx int) bool { Z2 := Z.Div(Zs[i]) xu := Curve.Identity() xl := Curve.Identity() @@ -74,6 +74,7 @@ func runVickrey(n int, bitlength int, tb testing.TB) { } tb.Logf("testing max_idx %d, i %d, bit %d:\n%v vs %v", max_idx, i, idx, X2, Z2) + return winner >= 0 } for idx := range bitlength { @@ -109,7 +110,7 @@ func runVickrey(n int, bitlength int, tb testing.TB) { // Winner test if !lost[i] { - checkWinner(Z, i, idx) + isWinner(Z, i, idx) } } result |= 1 << (bitlength - 1 - idx) @@ -147,7 +148,7 @@ func runVickrey(n int, bitlength int, tb testing.TB) { // Winner test if !lost[i] && winner < 0 { - checkWinner(Z, i, idx) + isWinner(Z, i, idx) } } result |= 1 << (bitlength - 1 - idx) @@ -161,4 +162,4 @@ func runVickrey(n int, bitlength int, tb testing.TB) { } } -func TestVickrey100on16bit(t *testing.T) { runVickrey(100, 16, t) } +func TestVickrey100on24bit(t *testing.T) { runVickrey(100, 32, t) } |