viff

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 diff
     1.1 --- a/apps/aes.py	Wed Nov 04 12:26:18 2009 +0100
     1.2 +++ b/apps/aes.py	Wed Nov 04 12:28:53 2009 +0100
     1.3 @@ -23,6 +23,7 @@
     1.4  import time
     1.5  from optparse import OptionParser
     1.6  from pprint import pformat
     1.7 +import sys
     1.8  
     1.9  import viff.reactor
    1.10  viff.reactor.install()
    1.11 @@ -178,7 +179,13 @@
    1.12      from viff.passive import PassiveRuntime
    1.13      runtime_class = PassiveRuntime
    1.14  
    1.15 -rt = create_runtime(id, players, 1, options, runtime_class)
    1.16 +try:
    1.17 +    threshold = len(players) - len(players[id].keys.keys()[0])
    1.18 +except IndexError:
    1.19 +    print >>sys.stderr, "PRSS keys in config file missing."
    1.20 +    sys.exit(1)
    1.21 +
    1.22 +rt = create_runtime(id, players, threshold, options, runtime_class)
    1.23  
    1.24  if options.preproc:
    1.25      rt.addCallback(preprocess)