viff

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 diff
     1.1 --- a/viff/runtime.py	Mon Oct 06 20:57:13 2008 +0200
     1.2 +++ b/viff/runtime.py	Tue Oct 07 20:00:49 2008 +0200
     1.3 @@ -799,11 +799,17 @@
     1.4  
     1.5          # At this point both share_a and share_b must be Share
     1.6          # objects. So we wait on them, multiply and reshare.
     1.7 +
     1.8 +        def recombine(shares):
     1.9 +            # Recombine the first 2t+1 shares.
    1.10 +            result = gather_shares(shares[:2*self.threshold+1])
    1.11 +            result.addCallback(shamir.recombine)
    1.12 +            return result
    1.13 +
    1.14          result = gather_shares([share_a, share_b])
    1.15          result.addCallback(lambda (a, b): a * b)
    1.16          self.schedule_callback(result, self._shamir_share)
    1.17 -        self.schedule_callback(result, self._recombine,
    1.18 -                               threshold=2*self.threshold)
    1.19 +        self.schedule_callback(result, recombine)
    1.20          return result
    1.21  
    1.22      @increment_pc