Universal hashing and the leftover hash lemma #
A two-universal hash family has collision probability at most 1 / |Output| on every pair of
distinct inputs. The seed is independent of the source and remains part of the output. The
leftover hash lemma compares this joint output to the same seed with an independent uniform value.
The statements allow any finite seed distribution satisfying the collision bound. They are information-theoretic results; efficient sampling and evaluation require separate certificates.
Main definitions #
Cslib.Probability.IsTwoUniversal: a pairwise collision bound for a sampled hash seed.Cslib.Probability.seededHash: reveal the independent hash seed and its digest together.
Main results #
Cslib.Probability.isTwoUniversal_iff_isUniversalHash: two-universality is1 / |Output|-universality.Cslib.Probability.IsTwoUniversal.collision_with_set_le: isolation by a union bound.Cslib.Probability.IsTwoUniversal.leftover_hash: the strong leftover hash lemma.Cslib.Probability.IsTwoUniversal.leftover_hash_conditional: extraction with side information.
References #
- T. Holenstein, Pseudorandom Generators from One-Way Functions: A Simple Construction for Any Hardness, Section 3.3, Lemma 1. Its collision argument generalizes from field hashing and uniform seeds to any seed distribution satisfying the two-universality bound.
- I. Haitner, S. Vadhan, The Many Entropies in One-Way Functions, Section 2.4.1, Definition 4 and Lemma 8.
Adapted from Probability/UniversalHash.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8, using the upstream finite-PMF distance.
Two-universality is 1 / |Output|-universality in the sense of
Cslib.Probability.IsUniversalHash.
An injective input representation preserves two-universality.
Applying a shared public hash seed cannot increase distance between source distributions.
An empty digest is already uniform. This exact case avoids charging an extraction error when the source has too little entropy to supply even one prefix bit.
Re-encoding a seed preserves universality when its distribution is pushed forward.
A hash fails to isolate a fixed input from a candidate set only if one of the other candidates collides with it. Two-universality and the union bound control this probability.
Two-universality bounds the average collision probability of the hashed source.
The strong leftover hash lemma, in squared form without logarithms or square roots.
The strong leftover hash lemma: the seed stays public and independent uniform bits replace the hash value, with error at most half the square root of output size times source collision.
A pointwise probability bound is sufficient for the leftover hash lemma. This is the
min-entropy form: use mass = 2⁻ᵏ for a source with at least k bits of min-entropy.
Revealing side information costs the average collision probability of the conditional sources. The hash seed is sampled independently of both the side information and the source.
Conditional leftover hashing in its usual square-root form.