aboutsummaryrefslogtreecommitdiff
path: root/nizk/vickrey_test.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@kesim.org>2024-11-17 21:36:29 +0100
committerÖzgür Kesim <oec@kesim.org>2024-11-17 21:36:29 +0100
commitdd65b09c996523346de8ca61bcfd309e4d9f16d1 (patch)
tree5ddc6bf2c12f9c3d665d613559e34374e1b13778 /nizk/vickrey_test.go
parent4edd858503b7c59c29465961bc38d079aeb68c85 (diff)
wip: winning detect works, albeit with a workaround
Diffstat (limited to 'nizk/vickrey_test.go')
-rw-r--r--nizk/vickrey_test.go9
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) }