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 wrap: on
line diff
--- a/viff/bedoza_triple.py	Fri Jul 23 11:09:42 2010 +0200
+++ b/viff/bedoza_triple.py	Fri Jul 23 11:18:04 2010 +0200
@@ -358,8 +358,6 @@
 
         self.runtime.increment_pc()
         
-        gen = PartialShareGenerator(self.Zp, self.runtime, self.random, self.paillier)
-
         def check(v, a, b, c):
             if v.value != 0:
                 raise Exception("TripleTest failed - The two triples were inconsistent.")
@@ -374,11 +372,9 @@
             v.addCallback(check, a, b, c)
             return v
 
-        random_shares = []
-        for _ in xrange(n):
-             random_shares.append(gen.generate_share(self.random.randint(0, self.Zp.modulus - 1)))
-
-        random_shares = add_macs(self.runtime, self.Zp, self.u_bound, self.alpha, self.random, self.paillier, random_shares)
+        gen = ShareGenerator(self.Zp, self.runtime, self.random, self.paillier, self.u_bound, self.alpha)
+        
+        random_shares = gen.generate_random_shares(n)
 
         results = [Deferred() for _ in xrange(n)]