viff

changeset 1350:43d0f2a811e1

Orlandi:Replace defer_value by succeed.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Tue, 27 Oct 2009 20:24:26 +0100
parents aa7eb230e042
children 46ffe8878fbf
files viff/orlandi.py
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/viff/orlandi.py	Tue Oct 27 20:06:37 2009 +0100
     1.2 +++ b/viff/orlandi.py	Tue Oct 27 20:24:26 2009 +0100
     1.3 @@ -15,7 +15,7 @@
     1.4  # You should have received a copy of the GNU Lesser General Public
     1.5  # License along with VIFF. If not, see <http://www.gnu.org/licenses/>.
     1.6  
     1.7 -from twisted.internet.defer import Deferred, gatherResults
     1.8 +from twisted.internet.defer import Deferred, gatherResults, succeed
     1.9  
    1.10  from viff.runtime import Runtime, Share, ShareList, gather_shares, preprocess
    1.11  from viff.util import rand
    1.12 @@ -1104,11 +1104,6 @@
    1.13                  l.addCallbacks(long, self.error_handler)
    1.14                  return l
    1.15  
    1.16 -            def defer_value(l):
    1.17 -                d = Deferred()
    1.18 -                d.callback(l)
    1.19 -                return d
    1.20 -
    1.21              def check((ais, bis, cis, alpha_randomness, dijs), alphas, gammas):
    1.22                  """So if B receives ai, bi, dij, ri, si, and the
    1.23                  randomness used in the computation of alpha, he then
    1.24 @@ -1216,8 +1211,8 @@
    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_alpha_randomness[player_id - 1] = defer_value(alpha_randomness)
    1.29 -                        ds_dijs[player_id - 1] = defer_value(dijs[player_id - 1])
    1.30 +                        ds_alpha_randomness[player_id - 1] = succeed(alpha_randomness)
    1.31 +                        ds_dijs[player_id - 1] = succeed(dijs[player_id - 1])
    1.32                      # Receive and recombine shares if this player is a
    1.33                      # receiver.
    1.34                      else: