viff

changeset 1394:86d966f49a8a

Orlandi: Moved exponentiation out of loop.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Thu, 12 Nov 2009 10:43:59 +0100
parents 36c8915d718a
children 3ede8d56ae64
files viff/orlandi.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/viff/orlandi.py	Thu Nov 12 10:43:57 2009 +0100
     1.2 +++ b/viff/orlandi.py	Thu Nov 12 10:43:59 2009 +0100
     1.3 @@ -1132,10 +1132,11 @@
     1.4  
     1.5                  # 3) the gammaij he received is equal to the gammaij
     1.6                  # he now computes based on the values he reveives
     1.7 +                modulus_3 = field.modulus**3
     1.8                  for j in xrange(len(ais)):
     1.9                      dij = dijs[j]
    1.10                      # 5) ... and dij < p^3.
    1.11 -                    if dij >= (field.modulus**3):
    1.12 +                    if dij >= (modulus_3):
    1.13                          raise OrlandiException("Inconsistent random value dij %i from player %i" % (dij, j + 1))
    1.14                      # gamma_ij = alpha_i^b_j Enc_ek_i(1;1)^d_ij
    1.15                      gammaij = tripple(alphas[self.id - 1], bis[j][0].value,