viff

changeset 1388:1f0250d3bd69

active: trim excessive comments
author Martin Geisler <mg@cs.au.dk>
date Wed, 04 Nov 2009 16:09:17 +0100
parents f3eed529bebe
children eb56e865f32b
files viff/active.py
diffstat 1 files changed, 2 insertions(+), 14 deletions(-) [+]
line diff
     1.1 --- a/viff/active.py	Wed Nov 04 15:52:25 2009 +0100
     1.2 +++ b/viff/active.py	Wed Nov 04 16:09:17 2009 +0100
     1.3 @@ -195,8 +195,6 @@
     1.4          If the verification succeeds, the T shares are returned,
     1.5          otherwise the errback is called.
     1.6          """
     1.7 -        # TODO: This is necessary since shamir.recombine expects
     1.8 -        # to receive a list of *pairs* of field elements.
     1.9          shares = map(lambda (i, s): (field(i+1), s), enumerate(shares))
    1.10  
    1.11          # Verify the sharings. If any of the assertions fail and
    1.12 @@ -220,9 +218,6 @@
    1.13          returned, otherwise the errback is called.
    1.14          """
    1.15          si_1, si_2 = shares
    1.16 -
    1.17 -        # TODO: This is necessary since shamir.recombine expects
    1.18 -        # to receive a list of *pairs* of field elements.
    1.19          si_1 = map(lambda (i, s): (field(i+1), s), enumerate(si_1))
    1.20          si_2 = map(lambda (i, s): (field(i+1), s), enumerate(si_2))
    1.21  
    1.22 @@ -263,8 +258,7 @@
    1.23              result.addCallback(self._verify_single, rvec, T, field, degree)
    1.24              return result
    1.25          else:
    1.26 -            # We cannot verify anything, so we just return the
    1.27 -            # first T shares.
    1.28 +            # We cannot verify anything.
    1.29              return rvec[:T]
    1.30  
    1.31          # do actual communication
    1.32 @@ -299,21 +293,17 @@
    1.33                                 rvec1, rvec2, T, field, d1, d2)
    1.34              return result
    1.35          else:
    1.36 -            # We cannot verify anything, so we just return the
    1.37 -            # first T shares.
    1.38 +            # We cannot verify anything.
    1.39              return (rvec1[:T], rvec2[:T])
    1.40  
    1.41          # do actual communication
    1.42          self.activate_reactor()
    1.43  
    1.44      def _share_single(self, si, degree, field):
    1.45 -        # TODO: Move common code between single_share and
    1.46 -        # double_share_random out to their own methods.
    1.47          inputters = range(1, self.num_players + 1)
    1.48          if self._hyper is None:
    1.49              self._hyper = hyper(self.num_players, field)
    1.50  
    1.51 -        # Every player shares the random value with two thresholds.
    1.52          svec = self.shamir_share(inputters, field, si, degree)
    1.53          rvec = self._hyper * Matrix([svec]).transpose()
    1.54          rvec = rvec.transpose().rows[0]
    1.55 @@ -327,7 +317,6 @@
    1.56          correct sharings of a random number using *degree* as the
    1.57          polynomial degree.
    1.58          """
    1.59 -        # Generate a random element.
    1.60          si = rand.randint(0, field.modulus - 1)
    1.61          svec, rvec = self._share_single(si, degree, field)
    1.62          result = gather_shares(svec[T:])
    1.63 @@ -343,7 +332,6 @@
    1.64          double-sharings of a random number using *d1* and *d2* as the
    1.65          polynomial degrees.
    1.66          """
    1.67 -        # Generate a random element.
    1.68          si = rand.randint(0, field.modulus - 1)
    1.69          svec1, rvec1 = self._share_single(si, d1, field)
    1.70          svec2, rvec2 = self._share_single(si, d2, field)