viff

changeset 1356:c467cba12cfb

Orlandi:Replace defer_share with succeed.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Tue, 27 Oct 2009 22:24:56 +0100
parents 58ebae853020
children ea45925aa060
files viff/orlandi.py
diffstat 1 files changed, 3 insertions(+), 14 deletions(-) [+]
line diff
     1.1 --- a/viff/orlandi.py	Tue Oct 27 22:01:24 2009 +0100
     1.2 +++ b/viff/orlandi.py	Tue Oct 27 22:24:56 2009 +0100
     1.3 @@ -1032,17 +1032,6 @@
     1.4              M_without_test_set = lists[0]
     1.5              T = lists[1]
     1.6  
     1.7 -            def defer_share(xi, (rho1, rho2), commitment):
     1.8 -                d1 = Deferred()
     1.9 -                d2 = Deferred()
    1.10 -                d3 = Deferred()
    1.11 -                d4 = Deferred()
    1.12 -                d1.callback(xi)
    1.13 -                d2.callback(rho1)
    1.14 -                d3.callback(rho2)
    1.15 -                d4.callback(commitment)
    1.16 -                return gatherResults([d1, d2, d3, d4])
    1.17 -
    1.18              def get_share(x, ls):
    1.19                  share = ls[x * 4]
    1.20                  rho1 = ls[x * 4 + 1]
    1.21 @@ -1176,9 +1165,9 @@
    1.22  
    1.23                  for player_id in xrange(1, len(self.players.keys()) + 1):
    1.24                      if player_id == self.id:
    1.25 -                        ds_a[player_id - 1] = defer_share(a.share, a.rho, a.commitment)
    1.26 -                        ds_b[player_id - 1] = defer_share(b.share, b.rho, b.commitment)
    1.27 -                        ds_c[player_id - 1] = defer_share(c.share, c.rho, c.commitment)
    1.28 +                        ds_a[player_id - 1] = succeed([a.share, a.rho[0], a.rho[1], a.commitment])
    1.29 +                        ds_b[player_id - 1] = succeed([b.share, b.rho[0], b.rho[1], b.commitment])
    1.30 +                        ds_c[player_id - 1] = succeed([c.share, c.rho[0], c.rho[1], c.commitment])
    1.31                          ds_alpha_randomness[player_id - 1] = succeed(alpha_randomness)
    1.32                          ds_dijs[player_id - 1] = succeed(dijs[player_id - 1])
    1.33                      # Receive and recombine shares if this player is a