viff

changeset 1298:2e11e0366d58

aes: removed trailing whitespace
author Martin Geisler <mg@cs.au.dk>
date Fri, 16 Oct 2009 23:45:59 +0200
parents 0a96f8ee4bd3
children 050decea7ad4
files viff/aes.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/viff/aes.py	Fri Oct 16 23:34:11 2009 +0200
     1.2 +++ b/viff/aes.py	Fri Oct 16 23:45:59 2009 +0200
     1.3 @@ -39,12 +39,12 @@
     1.4      if (use_lin_comb):
     1.5          r = share.runtime.lin_comb([2 ** i for i in range(8)], r_bits)
     1.6      else:
     1.7 -        r = reduce(lambda x,y: x + y, 
     1.8 +        r = reduce(lambda x,y: x + y,
     1.9                     [r_bits[i] * 2 ** i for i in range(8)])
    1.10  
    1.11      c = share.runtime.open(share + r)
    1.12      c_bits = [Share(share.runtime, GF256) for i in range(8)]
    1.13 -    
    1.14 +
    1.15      def decompose(byte, bits):
    1.16          value = byte.value
    1.17  
    1.18 @@ -73,7 +73,7 @@
    1.19      In every case *ciphertext* will be a list of shares over GF256.
    1.20      """
    1.21  
    1.22 -    def __init__(self, runtime, key_size, block_size=128, 
    1.23 +    def __init__(self, runtime, key_size, block_size=128,
    1.24                   use_exponentiation=False, quiet=False):
    1.25          """Initialize Rijndael.
    1.26  
    1.27 @@ -239,7 +239,7 @@
    1.28  
    1.29          for h in range(len(state)):
    1.30              row = state[h]
    1.31 -            
    1.32 +
    1.33              for i in range(len(row)):
    1.34                  bits = bit_decompose(self.invert(row[i]))
    1.35  
    1.36 @@ -248,7 +248,7 @@
    1.37                  bits.append(Share(self.runtime, GF256, GF256(1)))
    1.38  
    1.39                  if (use_lin_comb):
    1.40 -                    bits = [self.runtime.lin_comb(AES.A.rows[j], bits) 
    1.41 +                    bits = [self.runtime.lin_comb(AES.A.rows[j], bits)
    1.42                              for j in range(len(bits) - 1)]
    1.43                      row[i] = self.runtime.lin_comb(
    1.44                          [2**j for j in range(len(bits))], bits)
    1.45 @@ -256,7 +256,7 @@
    1.46                      # caution: order is lsb first
    1.47                      vector = AES.A * Matrix(zip(bits))
    1.48                      bits = zip(*vector.rows)[0]
    1.49 -                    row[i] = reduce(lambda x,y: x + y, 
    1.50 +                    row[i] = reduce(lambda x,y: x + y,
    1.51                                      [bits[j] * 2**j for j in range(len(bits))])
    1.52  
    1.53      def shift_row(self, state):
    1.54 @@ -350,7 +350,7 @@
    1.55  
    1.56      def preprocess(self, input):
    1.57          if (isinstance(input, str)):
    1.58 -            return [Share(self.runtime, GF256, GF256(ord(c))) 
    1.59 +            return [Share(self.runtime, GF256, GF256(ord(c)))
    1.60                      for c in input]
    1.61          else:
    1.62              for byte in input:
    1.63 @@ -362,7 +362,7 @@
    1.64      def encrypt(self, cleartext, key, benchmark=False, prepare_at_once=False):
    1.65          """Rijndael encryption.
    1.66  
    1.67 -        Cleartext and key should be either a string or a list of bytes 
    1.68 +        Cleartext and key should be either a string or a list of bytes
    1.69          (possibly shared as elements of GF256)."""
    1.70  
    1.71          start = time.time()