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 wrap: on
line diff
--- a/viff/orlandi.py	Tue Nov 03 15:12:03 2009 +0100
+++ b/viff/orlandi.py	Tue Nov 03 15:24:04 2009 +0100
@@ -686,7 +686,9 @@
         if cmul_result is  not None:
             return cmul_result
 
-        def multiply((x, y, d, e, c)):
+        def multiply((x, y, ds, c)):
+            d = ds[0]
+            e = ds[1]
             # [de]
             de = self._additive_constant(field(0), d * e)
             # e[x]
@@ -702,10 +704,9 @@
             return OrlandiShare(self, field, zi, rhoz, Cz)
 
         # d = Open([x] - [a])
-        d = self.open(share_x - triple_a)
         # e = Open([y] - [b])
-        e = self.open(share_y - triple_b)
-        result = gather_shares([share_x, share_y, d, e, triple_c])
+        ds = self.open_multiple_values([share_x - triple_a, share_y - triple_b])
+        result = gather_shares([share_x, share_y, ds, triple_c])
         result.addCallbacks(multiply, self.error_handler)
 
         # do actual communication