正在加载图片...
5.1.2 ShiftRows (Transformation In the shiftRows()transformation,the bytes in the last three rows of the State are cyclically shifted over different numbers of bytes (offsets).The first row,r=0,is not shifted. Specifically,the shiftRows (transformation proceeds as follows: ,e=S,.(e+sh(r,,b》mod N fOr0<r<4and0≤c<Nb, (5.3) where the shift value shifi(r,Nb)depends on the row number,r,as follows(recall that Nb=4): shift(1,4)=1;shif(2,4)=2;shif(3,4)=3. (5.4) This has the effect of moving bytes to "lower"positions in the row (i.e.,lower values of c in a given row),while the "lowest"bytes wrap around into the"top"of the row (i.e.,higher values of c in a given row). Figure 8 illustrates the shiftRows (transformation. ShiftRows() Sr.0 Sr Sr2 Sr.3 S S’ So.0 Soa S0,2 S03 S0.0 5o! S0,2 S03 S.0 S,1 S1,2 S1.3 S S12 S13 S10 S20 S21 S22 S23 S2,2 S23 S2.0 S2,1 S3,0 S3,2 S33 S3.0 S3,2 Figure 8.shiftRows ()cyclically shifts the last three rows in the State. 5.1.3 MixColumns (Transformation The MixColumns (transformation operates on the State column-by-column,treating each column as a four-term polynomial as described in Sec.4.3.The columns are considered as polynomials over GF(2)and multiplied modulox+1 with a fixed polynomial a(x),given by a(x)={03x3+{01}x2+{01}x+{02}. (5.5) As described in Sec.4.3,this can be written as a matrix multiplication.Let s'(x)=a(x)⑧s(x): 1717 5.1.2 ShiftRows() Transformation In the ShiftRows() transformation, the bytes in the last three rows of the State are cyclically shifted over different numbers of bytes (offsets). The first row, r = 0, is not shifted. Specifically, the ShiftRows() transformation proceeds as follows: r c r c shift r Nb Nb s s ,( ( , )) mod ' , = + for 0 < r < 4 and 0 £ c < Nb, (5.3) where the shift value shift(r,Nb) depends on the row number, r, as follows (recall that Nb = 4): shift(1,4) =1; shift(2,4) = 2 ; shift(3,4) = 3 . (5.4) This has the effect of moving bytes to “lower” positions in the row (i.e., lower values of c in a given row), while the “lowest” bytes wrap around into the “top” of the row (i.e., higher values of c in a given row). Figure 8 illustrates the ShiftRows() transformation. S S ’ 0,0 s 0,1 s 0,2 s 0,3 s 0,0 s 0,1 s 0,2 s 0,3 s 1,0 s 1,1 s 1,2 s 1,3 s 1,1 s 1,2 s 1,3 s 1,0 s 2,0 s 2,1 s 2,2 s 2,3 s 2,2 s 2,3 s 2,0 s 2,1 s 3,0 s 3,1 s 3,2 s 3,3 s 3,3 s 3,0 s 3,1 s 3,2 s Figure 8. ShiftRows() cyclically shifts the last three rows in the State. 5.1.3 MixColumns() Transformation The MixColumns() transformation operates on the State column-by-column, treating each column as a four-term polynomial as described in Sec. 4.3. The columns are considered as polynomials over GF(28 ) and multiplied modulo x 4 + 1 with a fixed polynomial a(x), given by a(x) = {03}x 3 + {01}x 2 + {01}x + {02} . (5.5) As described in Sec. 4.3, this can be written as a matrix multiplication. Let s¢(x) = a(x) Ä s(x): ShiftRows() r,0 s r,1 s r,2 s r,3 s ' r,0 s ' r,2 s ' r,3 s ' r,1 s
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有