2
$\begingroup$

This question already has an answer here:

enter image description here In above picture you can see a AES state array over 2 rounds through the S- and P-Boxes of AES. It's taken from here and intends to show how 2 rounds of transformation are necessary to achieve full diffusion after only the first byte has changed.

If one would MixColumns() before MixRows() diffusion, one would reach diffusion one step earlier. So I wonder what is the reason to ShiftRows() before MixColumns()?

$\endgroup$

marked as duplicate by Community Apr 11 at 22:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ If one would MixColumns() before MixRows() diffusion, one would reach diffusion one step earlier, could you please explain it more? $\endgroup$ – hardyrama Apr 11 at 17:45
  • $\begingroup$ @hardyrama Let's ignore the SubBytes() Operation since it doesn't affect Diffusion. If we MixColumns() in the fist step, the changed byte diffuses into the whole first column. After ShiftRows() is applied, theres one changed byte in every column. After another MixColumn() operation every byte in the state array has changed, requiring only 3 steps until diffusion was reached. $\endgroup$ – Andy Ef Apr 11 at 18:24
  • 1
    $\begingroup$ Take a look at the comments of this answer $\endgroup$ – Faulst Apr 11 at 19:53