changeset 1502:af533d7ae315

BeDOZa: Better incapsulation of internal representation for MACList.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Thu, 15 Jul 2010 11:37:50 +0200
parents 522203844397
children b120a9dee885
files viff/bedoza.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/viff/bedoza.py	Thu Jul 15 11:37:49 2010 +0200
+++ b/viff/bedoza.py	Thu Jul 15 11:37:50 2010 +0200
@@ -76,7 +76,7 @@
     def cmul(self, c):
         zi = c * self.value
         zks = self.keyList.cmul(c)
-        zms = BeDOZaMACList(map(lambda m: c * m, self.macs.get_macs()))
+        zms = self.macs.cmul(c)
         return BeDOZaShareContents(zi, zks, zms)
 
     def __str__(self):
@@ -160,6 +160,9 @@
 
     def get_mac(self, inx):
         return self.macs[inx]
+
+    def cmul(self, c):
+        return BeDOZaMACList(map(lambda m: c * m, self.macs))
         
     def __add__(self, other):
         """Addition."""