0b0001 0b0010 0b0011 0b0100 0b0101 0b0110 0b0111 0b1000 0b1001 0b1010

 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
A = [0b0001, 0b0010, 0b0011, 0b0100, 0b0101, 0b0110, 0b0111,
0b1000, 0b1001, 0b1010, 0b1011, 0b1100, 0b1101, 0b1110, 0b1111]
Vh = [0b0000, 0b0001, 0b0010, 0b0011, 0b0100, 0b0101, 0b0110, 0b0111,
0b1000, 0b1001, 0b1010, 0b1011, 0b1100, 0b1101, 0b1110, 0b1111]
TabS1 = {0b0000: 0b0011, 0b0001: 0b0101, 0b0010: 0b0110, 0b0011: 0b0100, 0b0100: 0b0101,
0b0101: 0b0001, 0b0110: 0b0010, 0b0111: 0b0101,
0b1000: 0b0111, 0b1001: 0b0110, 0b1010: 0b0010, 0b1011: 0b0011, 0b1100: 0b0111, 0b1101: 0b0100,
0b1110: 0b0001, 0b1111: 0b0011}
TabS2 = {0b0000: 0b0001, 0b0001: 0b0110, 0b0010: 0b0111, 0b0011: 0b0100, 0b0100: 0b0100,
0b0101: 0b0010, 0b0110: 0b0110, 0b0111: 0b0010,
0b1000: 0b0011, 0b1001: 0b0100, 0b1010: 0b0011, 0b1011: 0b0001, 0b1100: 0b0101, 0b1101: 0b0111,
0b1110: 0b0011, 0b1111: 0b0101}
TabS3 = {0b0000: 0b0001, 0b0001: 0b0011, 0b0010: 0b0011, 0b0011: 0b0010, 0b0100: 0b0001,
0b0101: 0b0010, 0b0110: 0b0011, 0b0111: 0b0010,
0b1000: 0b0010, 0b1001: 0b0011, 0b1010: 0b0010, 0b1011: 0b0001, 0b1100: 0b0001, 0b1101: 0b0011,
0b1110: 0b0011, 0b1111: 0b0001}
for i in range(0, len(A)):
f = open("resulttab1.txt", "a")
f.write('A = ' + str(bin(A[i])) + '\n')
for j in range(0, len(Vh)):
Vi = (TabS1[Vh[j]])
Vh1 = A[i] ^ Vh[j]
Vi1 = (TabS1[Vh1])
deltaC = Vi ^ Vi1
res = bin(Vh[j]), bin(Vi), bin(Vh1), bin(Vi1), bin(deltaC)
f.write(str(res) + '\n')
f.close()
for k in range(0, len(A)):
f = open("resulttab2.txt", "a")
f.write('A = ' + str(bin(A[k])) + '\n')
for j in range(0, len(Vh)):
Vi = (TabS1[Vh[j]])
Vh1 = A[k] ^ Vh[j]
Vi1 = (TabS1[Vh1])
deltaC = Vi ^ Vi1
res = bin(Vh[j]), bin(Vi), bin(Vh1), bin(Vi1), bin(deltaC)
f.write(str(res) + '\n')
f.close()
for t in range(0, len(A)):
f = open("resulttab3.txt", "a")
f.write('A = ' + str(bin(A[t])) + '\n')
for j in range(0, len(Vh)):
Vi = (TabS1[Vh[j]])
Vh1 = A[t] ^ Vh[j]
Vi1 = (TabS1[Vh1])
deltaC = Vi ^ Vi1
res = bin(Vh[j]), bin(Vi), bin(Vh1), bin(Vi1), bin(deltaC)
f.write(str(res) + '\n')
f.close()