Cryptography Reference
In-Depth Information
Algorithm 8.3
Round 2 of the MD4 hash function.
1. A ← ( A + g ( B, C, D )+ X [0] + c 1 ) 3
2. D ← ( D + g ( A, B, C )+ X [4] + c 1 ) 5
3. C ← ( C + g ( D, A, B )+ X [8] + c 1 ) 9
4. B ← ( B + g ( C, D, A )+ X [12] + c 1 ) 13
5. A ← ( A + g ( B, C, D )+ X [1] + c 1 ) 3
6. D ← ( D + g ( A, B, C )+ X [5] + c 1 ) 5
7. C ← ( C + g ( D, A, B )+ X [9] + c 1 ) 9
8. B ← ( B + g ( C, D, A )+ X [13] + c 1 ) 13
9. A ← ( A + g ( B, C, D )+ X [2] + c 1 ) 3
10. D
( D + g ( A, B, C )+ X [6] + c 1 )
5
11. C
( C + g ( D, A, B )+ X [10] + c 1 )
9
12. B
( B + g ( C, D, A )+ X [14] + c 1 )
13
13. A
( A + g ( B, C, D )+ X [3] + c 1 )
3
14. D
5
15. C ← ( C + g ( D, A, B )+ X [11] + c 1 ) 9
16. B ← ( B + g ( C, D, A )+ X [15] + c 1 ) 13
( D + g ( A, B, C )+ X [7] + c 1 )
'53
24
./
E
3
"53
Figure 8.3
The structure of a message preprocessed to be hashed using MD4.
At this point, the resulting message has a structure as illustrated in Figure 8.3.
It has a length that is an exact multiple of 512 bits. Consequently, it can be broken
up into 32-bit words, and the resulting number of words (i.e., N ) is still divisible by
16.
A 128-bit MD4 hash value can be constructed using Algorithm 8.1. In short,
the hash value is constructed as the concatenation of four words (or registers) A , B ,
C ,and D . First, the array M is constructed as discussed earlier, and the four registers
are initialized with constant values. The array M is then processed iteratively. In
each iteration, 16 words of M are taken and stored in an array X . The values of the
four registers are stored for later reuse. In the main part of the algorithm, three rounds
of hashing are performed (i.e., Round 1, Round 2, and Round 3). Each round consists
of one operation on each of the 16 words in X (described later). The operations
done in the three rounds produce new values for the four registers. Finally, the four
registers are updated by adding back the values that were stored previously (the
addition is always performed modulo 2 32 ).
Search WWH ::




Custom Search