changeset 1380:a466288e9280

apps/aes: Determine the threshold from PRSS keys in the config file.
author Marcel Keller <mkeller@cs.au.dk>
date Wed, 04 Nov 2009 12:28:53 +0100
parents a084a491dff7
children 6d2179a15b42
files apps/aes.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/apps/aes.py	Wed Nov 04 12:26:18 2009 +0100
+++ b/apps/aes.py	Wed Nov 04 12:28:53 2009 +0100
@@ -23,6 +23,7 @@
 import time
 from optparse import OptionParser
 from pprint import pformat
+import sys
 
 import viff.reactor
 viff.reactor.install()
@@ -178,7 +179,13 @@
     from viff.passive import PassiveRuntime
     runtime_class = PassiveRuntime
 
-rt = create_runtime(id, players, 1, options, runtime_class)
+try:
+    threshold = len(players) - len(players[id].keys.keys()[0])
+except IndexError:
+    print >>sys.stderr, "PRSS keys in config file missing."
+    sys.exit(1)
+
+rt = create_runtime(id, players, threshold, options, runtime_class)
 
 if options.preproc:
     rt.addCallback(preprocess)