changeset 683:c1ad22124f89

Benchmark would fail with only three players.
author Martin Geisler <mg@daimi.au.dk>
date Fri, 25 Apr 2008 11:26:05 +0200
parents f9fe663c0de1
children 95a26f4d2a9e
files apps/benchmark.py viff/runtime.py
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/apps/benchmark.py	Sat Apr 12 13:40:16 2008 +0200
+++ b/apps/benchmark.py	Fri Apr 25 11:26:05 2008 +0200
@@ -212,7 +212,7 @@
 else:
     benchmark = SequentialBenchmark
 
-pre_runtime = create_runtime(id, players, (len(players) -1)//3,
+pre_runtime = create_runtime(id, players, max((len(players) -1)//3, 1),
                              options, runtime_class)
 pre_runtime.addCallback(benchmark, operation)
 
--- a/viff/runtime.py	Sat Apr 12 13:40:16 2008 +0200
+++ b/viff/runtime.py	Fri Apr 25 11:26:05 2008 +0200
@@ -410,6 +410,7 @@
         L{create_runtime} function should be used instead to create a
         usable runtime.
         """
+        assert threshold > 0, "Must use a positive threshold."
         #: ID of this player.
         self.id = player.id
         #: Shamir secret sharing threshold.