viff

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 diff
     1.1 --- a/viff/orlandi.py	Fri Oct 16 18:42:52 2009 +0200
     1.2 +++ b/viff/orlandi.py	Fri Oct 16 18:46:28 2009 +0200
     1.3 @@ -25,8 +25,16 @@
     1.4  
     1.5  from hash_broadcast import HashBroadcastMixin
     1.6  
     1.7 -import commitment
     1.8 -commitment.set_reference_string(23434347834783478783478L, 489237823478234783478020L)
     1.9 +try:
    1.10 +    import commitment
    1.11 +    commitment.set_reference_string(23434347834783478783478L,
    1.12 +                                    489237823478234783478020L)
    1.13 +except ImportError:
    1.14 +    # The commitment module is not public, so we cannot expect the
    1.15 +    # import to work. Catching the ImportError here allows the
    1.16 +    # benchmark and tests to import viff.orlandi without blowing up.
    1.17 +    # It is only if the OrlandiRuntime is used that things blow up.
    1.18 +    pass
    1.19  
    1.20  # import logging
    1.21  # LOG_FILENAME = 'logging_example.out'