viff

changeset 1208:49c14731cf5e

Added option to use ActiveRuntime.
author Marcel Keller <mkeller@cs.au.dk>
date Thu, 10 Sep 2009 16:20:06 +0200
parents 2eb256e7e36c
children ec281b1151e1
files apps/aes.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/apps/aes.py	Wed Sep 09 11:24:10 2009 +0200
     1.2 +++ b/apps/aes.py	Thu Sep 10 16:20:06 2009 +0200
     1.3 @@ -55,6 +55,8 @@
     1.4  parser.add_option("-c", "--count", action="store", type="int",
     1.5                    help="Number of blocks to encrypt. Defaults to 1.")
     1.6  parser.set_defaults(count=1)
     1.7 +parser.add_option("-a", "--active", action="store_true", help="Use actively "
     1.8 +                  "secure runtime. Default is only passive security.")
     1.9  
    1.10  # Add standard VIFF options.
    1.11  Runtime.add_options(parser)
    1.12 @@ -101,7 +103,14 @@
    1.13      s = rt.synchronize()
    1.14      rt.schedule_complex_callback(s, encrypt, rt, key)
    1.15  
    1.16 -rt = create_runtime(id, players, 1, options)
    1.17 +if options.active:
    1.18 +    from viff.active import ActiveRuntime
    1.19 +    runtime_class = ActiveRuntime
    1.20 +else:
    1.21 +    from viff.passive import PassiveRuntime
    1.22 +    runtime_class = PassiveRuntime
    1.23 +
    1.24 +rt = create_runtime(id, players, 1, options, runtime_class)
    1.25  rt.addCallback(share_key)
    1.26  
    1.27  reactor.run()