viff

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 diff
     1.1 --- a/viff/bedoza.py	Thu Jul 15 11:37:49 2010 +0200
     1.2 +++ b/viff/bedoza.py	Thu Jul 15 11:37:50 2010 +0200
     1.3 @@ -76,7 +76,7 @@
     1.4      def cmul(self, c):
     1.5          zi = c * self.value
     1.6          zks = self.keyList.cmul(c)
     1.7 -        zms = BeDOZaMACList(map(lambda m: c * m, self.macs.get_macs()))
     1.8 +        zms = self.macs.cmul(c)
     1.9          return BeDOZaShareContents(zi, zks, zms)
    1.10  
    1.11      def __str__(self):
    1.12 @@ -160,6 +160,9 @@
    1.13  
    1.14      def get_mac(self, inx):
    1.15          return self.macs[inx]
    1.16 +
    1.17 +    def cmul(self, c):
    1.18 +        return BeDOZaMACList(map(lambda m: c * m, self.macs))
    1.19          
    1.20      def __add__(self, other):
    1.21          """Addition."""