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 wrap: on
line diff
--- a/viff/bedoza.py	Wed Jul 07 16:10:53 2010 +0200
+++ b/viff/bedoza.py	Wed Jul 07 16:11:48 2010 +0200
@@ -330,30 +330,6 @@
         zms = xms - yms
         return (zi, zks, zms)
 
-    def _cmul(self, share_x, share_y, field):
-        """Multiplication of a share with a constant.
-
-        Either share_x or share_y must be a BeDOZaShare but not
-        both. Returns None if both share_x and share_y are
-        BeDOZaShares.
-        """
-        if not isinstance(share_x, Share):
-            # Then share_y must be a Share => local multiplication. We
-            # clone first to avoid changing share_y.
-            assert isinstance(share_y, Share), \
-                "At least one of the arguments must be a share."
-            result = share_y.clone()
-            result.addCallback(self._constant_multiply, share_x)
-            return result
-        if not isinstance(share_y, Share):
-            # Likewise when share_y is a constant.
-            assert isinstance(share_x, Share), \
-                "At least one of the arguments must be a share."
-            result = share_x.clone()
-            result.addCallback(self._constant_multiply, share_y)
-            return result
-        return None
-
     def _constant_multiply(self, x, c):
         """Multiplication of a share-tuple with a constant c."""
         assert(isinstance(c, FieldElement))