A compression function combines one fixed-size message block with the previous fixed-size state, producing the next state in an iterative hash construction. In a Merkle–Damgård design, padded input is divided into equal-length blocks and processed sequentially until the final state becomes the hash value. section 6.3.1
The processing pattern is:
- Pad the input and divide it into equal-length message blocks. section 6.3.1
- Apply the compression function to the current block and previous state. section 6.3.1
- Repeat for every block, using the resulting state as the next input state. section 6.3.1
- Output the final state as the hash digest in a Merkle–Damgård construction. section 6.5
This role distinguishes compression functions from sponge permutations. A sponge absorbs input by XORing blocks with only its rate portion before applying a permutation; its untouched capacity contributes to collision resistance. section 6.3.2
Figure 6.5 The Merkle–Damgård construction for hash functions
Trace how message blocks and successive internal states flow through the Merkle–Damgård construction. section 6.3.1

