viff

changeset 954:a978f6160b41

Faster list unzipping.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 27 Sep 2008 10:50:44 +0200
parents e1b809d032df
children 92923dd24908
files viff/comparison.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/viff/comparison.py	Sat Sep 27 10:43:56 2008 +0200
     1.2 +++ b/viff/comparison.py	Sat Sep 27 10:50:44 2008 +0200
     1.3 @@ -79,8 +79,7 @@
     1.4          assert self.num_players + 2 < 2**l
     1.5  
     1.6          bits = [self.prss_share_bit_double(field) for _ in range(m)]
     1.7 -        int_bits = [a for (a, _) in bits]
     1.8 -        bit_bits = [b for (_, b) in bits]
     1.9 +        int_bits, bit_bits = zip(*bits)
    1.10  
    1.11          def bits_to_int(bits):
    1.12              """Converts a list of bits to an integer."""
    1.13 @@ -93,7 +92,7 @@
    1.14          a = share_a - share_b + 2**l
    1.15          T = self.open(2**t - int_b + a)
    1.16  
    1.17 -        result = gather_shares([T] + bit_bits)
    1.18 +        result = gather_shares((T,) + bit_bits)
    1.19          self.schedule_callback(result, self._finish_greater_than_equal, l)
    1.20          return result
    1.21