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.

enter image description here

I'm getting $(11001000)$ as answer while it should be $(10000011)$; the value of my input is $(11111110)$.

  • $\begingroup$ Welcome to Cryptography. So what are your values? $\endgroup$
    – kelalaka
    Mar 11, 2019 at 20:42
  • $\begingroup$ 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. $\endgroup$ Mar 11, 2019 at 21:19

1 Answer 1


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

R = IntegerModRing(2)
A = Matrix(R,[
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

The answer is


A is the 8x8 matrix, B is the column vector multiplied with A, C is the added vector and D is the result.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.