changeset 964:003ca9e1ad90

Fixed bug in multiplication protocol when n != 2t+1. All players now simply wait for the first 2t+1 shares.
author Martin Geisler <mg@daimi.au.dk>
date Tue, 07 Oct 2008 20:00:49 +0200
parents 4daa42544157
children 24ca90163151
files viff/runtime.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/viff/runtime.py	Mon Oct 06 20:57:13 2008 +0200
+++ b/viff/runtime.py	Tue Oct 07 20:00:49 2008 +0200
@@ -799,11 +799,17 @@
 
         # At this point both share_a and share_b must be Share
         # objects. So we wait on them, multiply and reshare.
+
+        def recombine(shares):
+            # Recombine the first 2t+1 shares.
+            result = gather_shares(shares[:2*self.threshold+1])
+            result.addCallback(shamir.recombine)
+            return result
+
         result = gather_shares([share_a, share_b])
         result.addCallback(lambda (a, b): a * b)
         self.schedule_callback(result, self._shamir_share)
-        self.schedule_callback(result, self._recombine,
-                               threshold=2*self.threshold)
+        self.schedule_callback(result, recombine)
         return result
 
     @increment_pc