Utilities/crypto/py3AES.py

changeset 3039
8dd0165d805d
parent 3034
7ce719013078
child 3060
5883ce99ee12
child 3160
209a07d7e401
--- a/Utilities/crypto/py3AES.py	Sat Oct 19 16:51:12 2013 +0200
+++ b/Utilities/crypto/py3AES.py	Sat Oct 19 17:42:18 2013 +0200
@@ -344,12 +344,12 @@
         for i in range(nbr):
             if isInv:
                 state[statePointer:statePointer + 4] = \
-                        state[statePointer + 3:statePointer + 4] + \
-                        state[statePointer:statePointer + 3]
+                    state[statePointer + 3:statePointer + 4] + \
+                    state[statePointer:statePointer + 3]
             else:
                 state[statePointer:statePointer + 4] = \
-                        state[statePointer + 1:statePointer + 4] + \
-                        state[statePointer:statePointer + 1]
+                    state[statePointer + 1:statePointer + 4] + \
+                    state[statePointer:statePointer + 1]
         return state
 
     def __mixColumns(self, state, isInv):
@@ -391,13 +391,13 @@
         g = self.__galois_multiplication
 
         column[0] = g(cpy[0], mult[0]) ^ g(cpy[3], mult[1]) ^ \
-                    g(cpy[2], mult[2]) ^ g(cpy[1], mult[3])
+            g(cpy[2], mult[2]) ^ g(cpy[1], mult[3])
         column[1] = g(cpy[1], mult[0]) ^ g(cpy[0], mult[1]) ^ \
-                    g(cpy[3], mult[2]) ^ g(cpy[2], mult[3])
+            g(cpy[3], mult[2]) ^ g(cpy[2], mult[3])
         column[2] = g(cpy[2], mult[0]) ^ g(cpy[1], mult[1]) ^ \
-                    g(cpy[0], mult[2]) ^ g(cpy[3], mult[3])
+            g(cpy[0], mult[2]) ^ g(cpy[3], mult[3])
         column[3] = g(cpy[3], mult[0]) ^ g(cpy[2], mult[1]) ^ \
-                    g(cpy[1], mult[2]) ^ g(cpy[0], mult[3])
+            g(cpy[1], mult[2]) ^ g(cpy[0], mult[3])
         return column
 
     def __aes_round(self, state, roundKey):

eric ide

mercurial