From dd65b09c996523346de8ca61bcfd309e4d9f16d1 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Sun, 17 Nov 2024 21:36:29 +0100 Subject: wip: winning detect works, albeit with a workaround --- nizk/vickrey_test.go | 9 +++++---- 1 file 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) } -- cgit v1.2.3