viff

changeset 1484:730cfc93b94a

SimpleArithmetic: Use the open_two_values method for basic_multiplication.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Thu, 08 Jul 2010 14:17:55 +0200
parents 32af54d63bce
children 0e1f9275e7ac
files viff/simplearithmetic.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/viff/simplearithmetic.py	Thu Jul 08 14:13:52 2010 +0200
     1.2 +++ b/viff/simplearithmetic.py	Thu Jul 08 14:17:55 2010 +0200
     1.3 @@ -141,7 +141,7 @@
     1.4          if cmul_result is  not None:
     1.5              return cmul_result
     1.6  
     1.7 -        def multiply((x, y, c, d, e)):
     1.8 +        def multiply((x, y, c, (d, e))):
     1.9              # [de]
    1.10              de = d * e
    1.11              # e[x]
    1.12 @@ -156,12 +156,11 @@
    1.13              z = self._plus((t1, t4), field)
    1.14              return self._wrap_in_share(z, field)
    1.15  
    1.16 -        #d = Open([x] - [a])
    1.17 -        d = self.output(share_x - triple_a)
    1.18 +        # d = Open([x] - [a])
    1.19          # e = Open([y] - [b])
    1.20 -        e = self.output(share_y - triple_b)
    1.21 +        de = self.open_two_values(share_x - triple_a, share_y - triple_b)
    1.22          # ds = self.open_multiple_values([share_x - triple_a, share_y - triple_b])
    1.23 -        result = gather_shares([share_x, share_y, triple_c, d, e])
    1.24 +        result = gather_shares([share_x, share_y, triple_c, de])
    1.25          result.addCallbacks(multiply, self.error_handler)
    1.26  
    1.27          # do actual communication