viff

changeset 1347:c12e4a568741

Orlandi:Use increment_pc() instead of incrementing the pc directly.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Tue, 27 Oct 2009 19:25:33 +0100
parents e72cd064566d
children 0fa9c0cad8eb
files viff/orlandi.py
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line diff
     1.1 --- a/viff/orlandi.py	Tue Oct 27 19:08:30 2009 +0100
     1.2 +++ b/viff/orlandi.py	Tue Oct 27 19:25:33 2009 +0100
     1.3 @@ -166,7 +166,7 @@
     1.4          assert number is None or self.id in inputters
     1.5          self.threshold = self.num_players - 1
     1.6  
     1.7 -        self.program_counter[-1] += 1
     1.8 +        self.increment_pc()
     1.9  
    1.10          def additive_shares_with_rho(x):
    1.11              """Returns a tuple of a list of tuples (player id, share,
    1.12 @@ -245,7 +245,7 @@
    1.13  
    1.14          field = share.field
    1.15  
    1.16 -        self.program_counter[-1] += 1
    1.17 +        self.increment_pc()
    1.18  
    1.19          def recombine_value(shares, Cx):
    1.20              x = 0
    1.21 @@ -305,7 +305,7 @@
    1.22  
    1.23          Party ``P_i sets [r]_i = (r_i, rho_ri, C_r)``.
    1.24          """
    1.25 -        self.program_counter[-1] += 1
    1.26 +        self.increment_pc()
    1.27  
    1.28          # P_i chooses at random r_i, rho_ri in Z_p x (Z_p)^2
    1.29          ri = field(rand.randint(0, field.modulus - 1))
    1.30 @@ -435,7 +435,7 @@
    1.31          # TODO: Communitcation costs?
    1.32          assert (self.id in inputters and number is not None) or (self.id not in inputters)
    1.33  
    1.34 -        self.program_counter[-1] += 1
    1.35 +        self.increment_pc()
    1.36  
    1.37          results = []
    1.38          def hack(_, peer_id):
    1.39 @@ -494,7 +494,7 @@
    1.40          assert isinstance(share_x, Share) or isinstance(share_y, Share), \
    1.41              "At least one of share_x and share_y must be a Share."
    1.42  
    1.43 -        self.program_counter[-1] += 1
    1.44 +        self.increment_pc()
    1.45  
    1.46          field = getattr(share_x, "field", getattr(share_y, "field", None))
    1.47  
    1.48 @@ -615,7 +615,7 @@
    1.49          assert isinstance(share_x, Share) or isinstance(share_y, Share), \
    1.50              "At least one of share_x and share_y must be a Share."
    1.51  
    1.52 -        self.program_counter[-1] += 1
    1.53 +        self.increment_pc()
    1.54  
    1.55          field = getattr(share_x, "field", getattr(share_y, "field", None))
    1.56          n = field(0)
    1.57 @@ -696,7 +696,7 @@
    1.58          assert isinstance(share_x, Share) or isinstance(share_y, Share), \
    1.59              "At least one of share_x and share_y must be a Share."
    1.60  
    1.61 -        self.program_counter[-1] += 1
    1.62 +        self.increment_pc()
    1.63  
    1.64          field = getattr(share_x, "field", getattr(share_y, "field", None))
    1.65          n = field(0)
    1.66 @@ -820,7 +820,7 @@
    1.67             ``[b_i] = (b_i, s_i, B)``, and ``[c_i] = (c_i, t_i, C)``.
    1.68  
    1.69          """
    1.70 -        self.program_counter[-1] += 1
    1.71 +        self.increment_pc()
    1.72  
    1.73          def random_number(p):
    1.74              return field(rand.randint(0, p - 1))
    1.75 @@ -1027,7 +1027,7 @@
    1.76          The triple ``(a, b, c)`` is secure in the Fcrs-hybrid model.
    1.77  
    1.78          """
    1.79 -        self.program_counter[-1] += 1
    1.80 +        self.increment_pc()
    1.81  
    1.82          M = []
    1.83