### changeset 1484:730cfc93b94a

SimpleArithmetic: Use the open_two_values method for basic_multiplication.
author Janus Dam Nielsen Thu, 08 Jul 2010 14:17:55 +0200 32af54d63bce 0e1f9275e7ac viff/simplearithmetic.py 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
```--- a/viff/simplearithmetic.py	Thu Jul 08 14:13:52 2010 +0200
+++ b/viff/simplearithmetic.py	Thu Jul 08 14:17:55 2010 +0200
@@ -141,7 +141,7 @@
if cmul_result is  not None:
return cmul_result

-        def multiply((x, y, c, d, e)):
+        def multiply((x, y, c, (d, e))):
# [de]
de = d * e
# e[x]
@@ -156,12 +156,11 @@
z = self._plus((t1, t4), field)
return self._wrap_in_share(z, field)

-        #d = Open([x] - [a])
-        d = self.output(share_x - triple_a)
+        # d = Open([x] - [a])
# e = Open([y] - [b])
-        e = self.output(share_y - triple_b)
+        de = self.open_two_values(share_x - triple_a, share_y - triple_b)
# ds = self.open_multiple_values([share_x - triple_a, share_y - triple_b])
-        result = gather_shares([share_x, share_y, triple_c, d, e])
+        result = gather_shares([share_x, share_y, triple_c, de])