/rev/a466288e9280
changeset: 1380:a466288e9280
user:      Marcel Keller <[email protected]>
date:      Wed Nov 04 12:28:53 2009 +0100
summary:   apps/aes: Determine the threshold from PRSS keys in the config file.

diffstat:

 apps/aes.py |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r a084a491dff7 -r a466288e9280 apps/aes.py
--- 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)
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk

Reply via email to