MD- 2


.

.

/* 16- . */

for i = 0 to N/16 1 do

/* i- X. */

For j = 0 to 15 do

X[j] = M[i*16 + j].

/* A AA, B BB, C CC, D DD. */

AA = A

BB = B

CC = C

DD = D

/* 1. */

/* [abcd k s i]

a = b + ((a + F(b,c,d) + X[k] + T[i]) << s). */

/* 16 */

[ABCD 0 7 1] [DABC 1 12 2] [CDAB 2 17 3] [BCDA 3 22 4]

[ABCD 4 7 5] [DABC 5 12 6] [CDAB 6 17 7] [BCDA 7 22 8]

[ABCD 8 7 9] [DABC 9 12 10] [CDAB 10 17 11] [BCDA 11 22 12]

[ABCD 12 7 13] [DABC 13 12 14] [CDAB 14 17 15] [BCDA 15 22 16]

/* 2. */

/* [abcd k s i]

a = b + ((a + G(b,c,d) + X[k] + T[i]) << s). */

/* 16 */

[ABCD 1 5 17] [DABC 6 9 18] [CDAB 11 14 19] [BCDA 0 20 20]

[ABCD 5 5 21] [DABC 10 9 22] [CDAB 15 14 23] [BCDA 4 20 24]

[ABCD 9 5 25] [DABC 14 9 26] [CDAB 3 14 27] [BCDA 8 20 28]

[ABCD 13 5 29] [DABC 2 9 30] [CDAB 7 14 31] [BCDA 12 20 32]

a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */

/* 2. */

/* [abcd k s i]

a = b + ((a + H(b,c,d) + X[k] + T[i]) << s). */

/* 16 */

[ABCD 5 4 33] [DABC 8 11 34] [CDAB 11 16 35] [BCDA 14 23 36]

[ABCD 1 4 37] [DABC 4 11 38] [CDAB 7 16 39] [BCDA 10 23 40]

[ABCD 13 4 41] [DABC 0 11 42] [CDAB 3 16 43] [BCDA 6 23 44]

[ABCD 9 4 45] [DABC 12 11 46] [CDAB 15 16 47] [BCDA 2 23 48]

/* 4. */

/* [abcd k s i]

a = b + ((a + I(b,c,d) + X[k] + T[i]) << s). */