viff

changeset 1392:ff5f3ce6501c

Orlandi: Use open_multiple_values.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Tue, 03 Nov 2009 15:24:04 +0100
parents a798274e8537
children 3ede8d56ae64
files viff/orlandi.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/viff/orlandi.py	Tue Nov 03 15:12:03 2009 +0100
     1.2 +++ b/viff/orlandi.py	Tue Nov 03 15:24:04 2009 +0100
     1.3 @@ -686,7 +686,9 @@
     1.4          if cmul_result is  not None:
     1.5              return cmul_result
     1.6  
     1.7 -        def multiply((x, y, d, e, c)):
     1.8 +        def multiply((x, y, ds, c)):
     1.9 +            d = ds[0]
    1.10 +            e = ds[1]
    1.11              # [de]
    1.12              de = self._additive_constant(field(0), d * e)
    1.13              # e[x]
    1.14 @@ -702,10 +704,9 @@
    1.15              return OrlandiShare(self, field, zi, rhoz, Cz)
    1.16  
    1.17          # d = Open([x] - [a])
    1.18 -        d = self.open(share_x - triple_a)
    1.19          # e = Open([y] - [b])
    1.20 -        e = self.open(share_y - triple_b)
    1.21 -        result = gather_shares([share_x, share_y, d, e, triple_c])
    1.22 +        ds = self.open_multiple_values([share_x - triple_a, share_y - triple_b])
    1.23 +        result = gather_shares([share_x, share_y, ds, triple_c])
    1.24          result.addCallbacks(multiply, self.error_handler)
    1.25  
    1.26          # do actual communication