I am aware that MixColumns is a mixing operation which operates on the columns of the state, combining the four bytes in each column. So we multiply our state with the special matrix. To multiply, we’re computing many dot products. And for each dot product, we’re multiplying bytes as Galois fields $\pmod 2$, then reducing the answers $\bmod$ the magic polynomial: $x^8+x^4+x^3+x^1+x^0$.

Thankfully, the entire task can be greatly sped up by using a few look-up tables. The multiplication matrix consists of Galois fields for $1,2,3$. So we can pre-compute the results of all 256 eight-bit Galois fields (the possible bytes in our state) multiplied by these values.

How will I implement the inverse MixColumns for decryption process?


MixColumns implements a matrix multiplication, so InvMixColumns is the multiplication by the inverse of that matrix. Thus, it boils down to computing the inverse of the matrix. It can be tedious to do by hand, but it involves only straightforward computations. Alternatively, look up the AES standard itself (FIPS 197): the inverse matrix is spelled out explicitly in section 5.3.3.

More generally, FIPS 197 is quite readable (as standards go) and if you want to know how AES works, it is recommended to read it through (and in particular section 4, that gives some details on the underlying mathematics).


Once you inverted the Mix Column Matrix,

$$ InverseMix Column = \begin{bmatrix} 0E & 0B & 0D & 09\\ 09 & 0E & 0B & 0D\\ 0D & 09 & 0E & 0B\\ 0B & 0D & 09 & 0E\\ \end{bmatrix} $$

you can use the E and L tables. see an example at


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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