viff

changeset 1490:e837d8eec15d

BeDOZa: generate_random_shares now handles any number of players.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Mon, 12 Jul 2010 13:54:07 +0200
parents f3c3dba59fd8
children 5daa155c1d0b
files viff/bedoza.py
diffstat 1 files changed, 2 insertions(+), 9 deletions(-) [+]
line diff
     1.1 --- a/viff/bedoza.py	Mon Jul 12 12:00:32 2010 +0200
     1.2 +++ b/viff/bedoza.py	Mon Jul 12 13:54:07 2010 +0200
     1.3 @@ -121,15 +121,8 @@
     1.4          self.init_keys(field)
     1.5          shares = []
     1.6          for i in xrange(0, number_of_shares):
     1.7 -            if self.id == 1:
     1.8 -                v = field(1)
     1.9 -                shares.append(self.generate_share(field, v))
    1.10 -            if self.id == 2:
    1.11 -                v = field(2)
    1.12 -                shares.append(self.generate_share(field, v))
    1.13 -            if self.id == 3:
    1.14 -                v = field(3)
    1.15 -                shares.append(self.generate_share(field, v))
    1.16 +            v = field(self.id)
    1.17 +            shares.append(self.generate_share(field, v))
    1.18          return shares
    1.19  
    1.20      def generate_share(self, field, value):