I found these images depicting the AES decryption process:

enter image description here enter image description here

In the first image, the MixColumns step comes before the AddRoundKey step, while in the second image, the AddRoundKey will come before the MixColumns.

Which order is the correct one?

  • 3
    $\begingroup$ Have a look at my answer to »Why is MixColumns omitted from the last round of AES?«. Both are correct, but with a different expanded key. $\endgroup$ May 25, 2012 at 17:54
  • $\begingroup$ what do you mean by different expanded key? $\endgroup$
    – goldroger
    May 25, 2012 at 18:02
  • 4
    $\begingroup$ Did you actually read the linked answer? You'll see that the third code block uses InvMixColumns(ExpandedKey[i]) instead of ExpandedKey[i] (in the last block, this is shown as EqExpandedKey[i]). $\endgroup$ May 25, 2012 at 18:06
  • $\begingroup$ @JohnPaulParreño: I'd correct my answer (I originally talked about the ShiftRows and SubBytes operation), however, I can't really say it better than that Paŭlo said in his answer that he linked to; look at that. $\endgroup$
    – poncho
    May 25, 2012 at 23:18
  • $\begingroup$ possible duplicate of Why is MixColumns omitted from the last round of AES? $\endgroup$
    – mikeazo
    Jun 4, 2012 at 19:21

3 Answers 3


InvMixColumns is a linear operation. And because of that it follows:

InvMixColumn(x+RoundKey) = InvMixColumn(x) + InvMixColumn(RoundKey)
                                         "new" round key for decryption

So, the structure on the right is compatible with the structure on the left as long as you use different round keys. The idea behind this is to make the decryption structure look like encryption structure with just a couple of "Inv"s in there. But I'm actually not sure what the benefit of this is. For a block cipher like Anubis (which is similar to AES) it makes much more sense because each operation is an involution. The only difference between encryption and decryption for Anubis are the round keys. So, you can reuse the encryption code for decryption which is a nice property.


Not sure if this is answered fully, but if you check wikipedia, you'll see that AddRoundKey occurs 3 times in total with 1 time before and 1 time after the MixColumns operation.

However, if you are just considering the middle rounds then the MixColumns comes before


After the AddRoundKey step, except for the last round, where it does not happen


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.