liveBook · Manning

Compression function

As explained in Hacking Cryptography

A function that combines a fixed-size message block with a fixed-size state to produce a new fixed-size state in an iterative hash construction.

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
figure

Trace how message blocks and successive internal states flow through the Merkle–Damgård construction. section 6.3.1

How Hacking Cryptography covers it

How deep it goes
Defines sequential state updates and contrasts sponge processing, without detailing the internal round function of a specific hash.
Examples
Uses MD5, SHA-1, SHA-256, and SHA-512 as Merkle–Damgård hash-function examples.
What it assumes
Assumes fixed-size blocks, padding, and hash state; distinguishes these from sponge rate, capacity, and permutation processing.
What you can do after
Evaluate/understand how iterative hash constructions transform message blocks into successive internal states.
How it connects
Connects Merkle–Damgård construction, hash functions, sponge construction, collision resistance, and length-extension attacks.

Also explained in

Compare how 2 books explain compression function →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hacking Cryptography. The section links point to the parts of the book it draws on.