Cryptography Reference
In-Depth Information
Round 3
:For
j
=40
,
1
,...,
59, set,
(
LS
5
A
+
f
3
(
B,C,D
)+
E
+
X
j
+
c
3
,A,
LS
30
(
B
)
,C,D
)
→
(
A, B, C, D, E
)
.
Round 4
:For
j
=60
,
1
,...,
79, set,
(
LS
5
A
+
f
2
(
B,C,D
)+
E
+
X
j
+
c
4
,A,
LS
30
(
B
)
,C,D
)
→
(
A, B, C, D, E
)
.
6. After completion of the fourth round (or 80th step), we assign
(
H
1
+
A, H
2
+
B,H
3
+
C,H
4
+
D,H
5
+
E
)
→
(
A, B, C, D, E
)
.
which is the output message digest of 160 bits.
One could simplify the rounds as a single set of iterations as follows.
For each
i
=1
,
2
,
3
,
4, set the following storage for each of the values:
j
= 20(
i
−
1)
,
20(
i
−
1)+1
,...,
20(
i
−
1)+19
,
(
LS
5
A
+
f
i
(
B,C,D
)+
E
+
X
j
+
c
i
,A,
LS
30
(
B
)
,C,D
)
−−−−→
(7.2)
(
A, B, C, D, E
)
,
where
f
4
=
f
2
.
Diagram 7.1 illustrates a single stepin a single round, which is actually one
iteration of (7.2). Diagram 7.2 gives the complete processing of a 512-bit block
(assuming step4 above is completed).
Diagram 7.1 SHA-1 Single Step
+
+
←−−−−
↑
↑
↓
LS
5
f
i
↑
X
j
→
+
↑ ↑ ↑
A B C D E
↓
LS
30
c
i
→
+
A B C D E
Step j in Round i
Search WWH ::
Custom Search