viff

changeset 1476:5eed4049d9bb

BeDOZa: Use _cmul method in SimpleArithmetic.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Wed, 07 Jul 2010 16:11:48 +0200
parents 04d59fc3e12e
children 9b133830f06a
files viff/bedoza.py
diffstat 1 files changed, 0 insertions(+), 24 deletions(-) [+]
line diff
     1.1 --- a/viff/bedoza.py	Wed Jul 07 16:10:53 2010 +0200
     1.2 +++ b/viff/bedoza.py	Wed Jul 07 16:11:48 2010 +0200
     1.3 @@ -330,30 +330,6 @@
     1.4          zms = xms - yms
     1.5          return (zi, zks, zms)
     1.6  
     1.7 -    def _cmul(self, share_x, share_y, field):
     1.8 -        """Multiplication of a share with a constant.
     1.9 -
    1.10 -        Either share_x or share_y must be a BeDOZaShare but not
    1.11 -        both. Returns None if both share_x and share_y are
    1.12 -        BeDOZaShares.
    1.13 -        """
    1.14 -        if not isinstance(share_x, Share):
    1.15 -            # Then share_y must be a Share => local multiplication. We
    1.16 -            # clone first to avoid changing share_y.
    1.17 -            assert isinstance(share_y, Share), \
    1.18 -                "At least one of the arguments must be a share."
    1.19 -            result = share_y.clone()
    1.20 -            result.addCallback(self._constant_multiply, share_x)
    1.21 -            return result
    1.22 -        if not isinstance(share_y, Share):
    1.23 -            # Likewise when share_y is a constant.
    1.24 -            assert isinstance(share_x, Share), \
    1.25 -                "At least one of the arguments must be a share."
    1.26 -            result = share_x.clone()
    1.27 -            result.addCallback(self._constant_multiply, share_y)
    1.28 -            return result
    1.29 -        return None
    1.30 -
    1.31      def _constant_multiply(self, x, c):
    1.32          """Multiplication of a share-tuple with a constant c."""
    1.33          assert(isinstance(c, FieldElement))