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 wrap: on
line diff
--- a/apps/aes.py	Wed Sep 09 11:24:10 2009 +0200
+++ b/apps/aes.py	Thu Sep 10 16:20:06 2009 +0200
@@ -55,6 +55,8 @@
 parser.add_option("-c", "--count", action="store", type="int",
                   help="Number of blocks to encrypt. Defaults to 1.")
 parser.set_defaults(count=1)
+parser.add_option("-a", "--active", action="store_true", help="Use actively "
+                  "secure runtime. Default is only passive security.")
 
 # Add standard VIFF options.
 Runtime.add_options(parser)
@@ -101,7 +103,14 @@
     s = rt.synchronize()
     rt.schedule_complex_callback(s, encrypt, rt, key)
 
-rt = create_runtime(id, players, 1, options)
+if options.active:
+    from viff.active import ActiveRuntime
+    runtime_class = ActiveRuntime
+else:
+    from viff.passive import PassiveRuntime
+    runtime_class = PassiveRuntime
+
+rt = create_runtime(id, players, 1, options, runtime_class)
 rt.addCallback(share_key)
 
 reactor.run()