viff

changeset 1519:d7840af5cbf8

BeDOZa: ShareGenerator in generate_triples.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Fri, 23 Jul 2010 11:18:04 +0200
parents 4d229908e78f
children d5e0360a3566
files viff/bedoza_triple.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line diff
     1.1 --- a/viff/bedoza_triple.py	Fri Jul 23 11:09:42 2010 +0200
     1.2 +++ b/viff/bedoza_triple.py	Fri Jul 23 11:18:04 2010 +0200
     1.3 @@ -358,8 +358,6 @@
     1.4  
     1.5          self.runtime.increment_pc()
     1.6          
     1.7 -        gen = PartialShareGenerator(self.Zp, self.runtime, self.random, self.paillier)
     1.8 -
     1.9          def check(v, a, b, c):
    1.10              if v.value != 0:
    1.11                  raise Exception("TripleTest failed - The two triples were inconsistent.")
    1.12 @@ -374,11 +372,9 @@
    1.13              v.addCallback(check, a, b, c)
    1.14              return v
    1.15  
    1.16 -        random_shares = []
    1.17 -        for _ in xrange(n):
    1.18 -             random_shares.append(gen.generate_share(self.random.randint(0, self.Zp.modulus - 1)))
    1.19 -
    1.20 -        random_shares = add_macs(self.runtime, self.Zp, self.u_bound, self.alpha, self.random, self.paillier, random_shares)
    1.21 +        gen = ShareGenerator(self.Zp, self.runtime, self.random, self.paillier, self.u_bound, self.alpha)
    1.22 +        
    1.23 +        random_shares = gen.generate_random_shares(n)
    1.24  
    1.25          results = [Deferred() for _ in xrange(n)]
    1.26