changeset 1289:da51b765a791

orlandi: fix benchmark for people without the commitment module
author Martin Geisler <mg@cs.au.dk>
date Fri, 16 Oct 2009 18:46:28 +0200
parents f4341ec45321
children 622bf474f8c8
files viff/orlandi.py
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/viff/orlandi.py	Fri Oct 16 18:42:52 2009 +0200
+++ b/viff/orlandi.py	Fri Oct 16 18:46:28 2009 +0200
@@ -25,8 +25,16 @@
 
 from hash_broadcast import HashBroadcastMixin
 
-import commitment
-commitment.set_reference_string(23434347834783478783478L, 489237823478234783478020L)
+try:
+    import commitment
+    commitment.set_reference_string(23434347834783478783478L,
+                                    489237823478234783478020L)
+except ImportError:
+    # The commitment module is not public, so we cannot expect the
+    # import to work. Catching the ImportError here allows the
+    # benchmark and tests to import viff.orlandi without blowing up.
+    # It is only if the OrlandiRuntime is used that things blow up.
+    pass
 
 # import logging
 # LOG_FILENAME = 'logging_example.out'