19.5 The ShiftRow Transformation

Team-Fly

19.5 The ShiftRow Transformation

The next step in the cycle of a round consists in the permutation of a block at the byte level. To this end the bytes are exchanged within the individual lines (bi,0, bi,1, bi,2,..., ) of a block according to the schemata depicted in Tables 19.11-19.13.

Table 19.11: ShiftRow for blocks of length 128 bits (Lb = 4)

Before ShiftRow

After ShiftRow

0

4

8

12

0

4

8

12

1

5

9

13

5

9

13

1

2

6

10

14

10

14

2

6

3

7

11

15

15

3

7

11

Table 19.12: ShiftRow for blocks of length 192 bits (Lb = 6)

Before ShiftRow

After ShiftRow

0

4

8

12

16

20

0

4

8

12

16

20

1

5

9

13

17

21

5

9

13

17

21

1

2

6

10

14

18

22

10

14

18

22

2

6

3

7

11

15

19

23

15

19

23

3

7

11

Table 19.13: ShiftRow for blocks of length 256 bits (Lb = 8)

Before ShiftRow

After ShiftRow

0

4

8

12

16

20

24

28

0

4

8

12

16

20

24

28

1

5

9

13

17

21

25

29

5

9

13

17

21

25

29

1

2

6

10

14

18

22

26

30

14

18

22

26

30

2

6

10

3

7

11

15

19

23

27

31

19

23

27

31

3

7

11

15

In each first row no exchange takes place. In lines i = 2, 3, 4 the bytes are rotated left by positions, from position j to position j mod Lb, where is taken from Table 19.14

Table 19.14: Distances of line rotations in ShiftRow

Lb

4

1

2

3

6

1

2

3

8

1

3

4

For inverting this step positions j in rows i = 2, 3, 4 are shifted to positions j + mod Lb.


Team-Fly


Cryptography in C and C++
Cryptography in C and C++
ISBN: 189311595X
EAN: 2147483647
Year: 2001
Pages: 127

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net