def xor state key round for row in range len state for column in range

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def xor(state, key, round):
for row in range(len(state)):
for column in range(len(state[row])):
state[row][column] ^= key[row][column+round*4]
return state
state = [
[]
[]
[]
[]
]
key = [
[]
[]
[]
[]
]
state = xor(state, key, round=1)
for row in state:
p = ''
for cell in row:
p += hex(cell)[2:].zfill(2)
print p