One-way compression function: Difference between revisions

Content deleted Content added
Mamling (talk | contribs)
m Fix grammar
Mamling (talk | contribs)
m Fox grammar
Line 51:
It feeds each block of the message (m<sub>i</sub>) as the cleartext to be encrypted. The output ciphertext is then XORed (<math>\oplus</math>) with the same message block (m<sub>i</sub>) and then also XORed with the previous hash value (H<sub>i-1</sub>) to produce the next hash value (H<sub>i</sub>). The previous hash value (H<sub>i-1</sub>) is fed as the key to the block cipher. In the first round when there is no previous hash value it uses a constant pre-specified initial value (H<sub>0</sub>).
 
If the block cipher havehas different block and key sizesizes the hash value (H<sub>i-1</sub>) will have the wrong size for use as the key. The cipher might also have other special requirements on the key. Then the hash value is first fed through the function g( ) to be converted/padded to fit as key for the cipher.
 
<math>H_i = E_{g(H_{i-1})}(m_i)\oplus H_{i-1}\oplus m_i</math>