I am trying to create an aes mix column function in python. But the result is not as expected. What am I doing wrong?
Here I test on the first column.
[2, 3, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 3, 1, 1, 2]
[0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255]
print((0*2)^(17*3)^(34*1)^(51*1))
print((0*1)^(17*2)^(34*3)^(51*1))
print((0*1)^(17*1)^(34*2)^(51*3))
print((0*3)^(17*1)^(34*1)^(51*2))
The result is as follows:
34
119
204
85
What I think is the expected result is:
34
119
0
85
Is the expected result wrong or am I doing wrong?