# While doing the affine mapping after calculating the inverse of my polynomial using the EEA, I am not getting the value of the inverse as it should be

This is the image of matrix multiplication. It is the affine mapping step in the s box layer of AES. My value is not what it should be, therefore I just wanted it to be confirmed by someone else. I'm getting $$(11001000)$$ as answer while it should be $$(10000011)$$; the value of my input is $$(11111110)$$.

• Welcome to Cryptography. So what are your values? – kelalaka Mar 11 '19 at 20:42
• Should be, according to what references? Where did these matrices come from? Where did the expected answer come from? Your matrix arithmetic as presented is correct, so it seems if you're having trouble it must be elsewhere. – Squeamish Ossifrage Mar 11 '19 at 21:19

After a small coding with the SageMath, these are the steps;

R = IntegerModRing(2)
A = Matrix(R,[
[1,0,0,0,1,1,1,1],
[1,1,0,0,0,1,1,1],
[1,1,1,0,0,0,1,1],
[1,1,1,1,0,0,0,1],
[1,1,1,1,1,0,0,0],
[0,1,1,1,1,1,0,0],
[0,0,1,1,1,1,1,0],
[0,0,0,1,1,1,1,1]])
B = Matrix(R,8,1,[1,1,1,1,1,1,1,0])
C = Matrix(R,8,1,[1,1,0,0,0,1,1,0])
D = A*B+C


[1,1,0,0,1,0,0,0]