The leftover hash lemma for several independent samples #
When the same public seed k of a universal or almost-universal hash family is used to hash
several mutually independent inputs source : ι → PMF Input, the resulting tuple of digests is
jointly close to independent uniform outputs even with k revealed. Conditioned on each seed k,
the coordinate digests (source i).map (hash k) are independent, so the hybrid bound for
conditionally independent products (Cslib.Probability.PMF.dist_bind_pair_pi_le_sum) sums the
single-sample leftover-hash bounds (Cslib.Probability.IsUniversalHash.leftover_hash) across
i : ι. Unlike Cslib.Probability.IsTwoUniversal.leftover_hash_pi_conditional in
EntropyExtraction.lean, which hashes a single joint tuple once, these theorems hash each
coordinate separately under one shared seed.
For a (1 + α) / |Output|-universal hash family and independent samples each of guessing
probability at most γ, the statistical distance to uniform is at most
|ι| * √(|Output| * γ + α) / 2 ([BS23], §8.10.4, Theorem 8.11, p. 334).
Deviations from the book #
- Samples are indexed by a finite type
ι([Fintype ι] [DecidableEq ι]) rather than1, …, m; their joint law isPMF.pi source : PMF (ι → Input)and the digest tuple lies inι → Output(withFintype.card ιin place ofm). SeedandOutputcarry[Fintype Seed],[Fintype Output]and[Nonempty Output], andInputcarries[Finite Input].- The guessing-probability bound $\max_{x \in \mathcal{S}} \Pr[s_i = x] \le \gamma$ is stated as
the pointwise bound
∀ i x, (source i x).toReal ≤ γrather than a supremum overInput. - The
(1 + α) / |Output|-universal hypothesis inIsUniversalHash.leftover_hash_pi_of_mass_leandIsUniversalHash.dist_seededHash_pi_uniformOfFintype_letakes the explicit nonnegativity premisehα : 0 ≤ 1 + α. Mathematically a collision probability is nonnegative, so0 ≤ (1 + α) / |Output|; in Lean,IsUniversalHashtakes anℝ≥0∞bound andENNReal.ofReal ((1 + α) / Fintype.card Output)clamps negative reals to0, which would otherwise make the premise hold for an injective hash onBoolatα = -2while the right-hand side evaluates to0against an actual distance of1 / 2. IsUniversalHash.leftover_hash_piandIsUniversalHash.leftover_hash_pi_of_mass_leallow any seed distributionseed : PMF Seed, not onlyPMF.uniformOfFintype Seed;IsUniversalHash.dist_seededHash_pi_uniformOfFintype_lespecializes to a uniform seed onSeedagainstPMF.uniformOfFintype (Seed × (ι → Output))as printed in Theorem 8.11.
Main results #
Cslib.Probability.IsUniversalHash.leftover_hash_pi: multi-sample leftover hash lemma forε-universal families in terms of each sample's collision probability.Cslib.Probability.IsUniversalHash.leftover_hash_pi_of_mass_le: Theorem 8.11 for an arbitrary seed distributionseed : PMF Seedunder a pointwise guessing-probability boundγand0 ≤ 1 + α.Cslib.Probability.IsUniversalHash.dist_seededHash_pi_uniformOfFintype_le: Theorem 8.11 as printed ([BS23], §8.10.4, p. 334), comparing againstPMF.uniformOfFintype (Seed × (ι → Output)).Cslib.Probability.IsTwoUniversal.leftover_hash_pi,Cslib.Probability.IsTwoUniversal.leftover_hash_pi_of_mass_le: specializations to two-universal hash families (α = 0).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Section 8.10.4, Theorem 8.11, p. 334.
Multi-sample leftover hash lemma for ε-universal families: hashing independent samples
under one shared public seed is within the sum of the single-sample leftover-hash bounds of the
seed paired with an independent uniform tuple.
Theorem 8.11 (Leftover Hash Lemma for several samples) ([BS23], §8.10.4,
p. 334), for any seed distribution: if hash is (1 + α) / |Output|-universal with 0 ≤ 1 + α
and each independent sample source i has guessing probability at most γ, then hashing all
samples under one shared public seed is within |ι| * √(|Output| * γ + α) / 2 of the seed paired
with an independent uniform tuple.
Theorem 8.11 (Leftover Hash Lemma) as printed ([BS23], §8.10.4, p. 334):
for a (1 + α) / |Output|-universal hash function with 0 ≤ 1 + α, a uniform seed on Seed, and
independent samples source i each with guessing probability at most γ, the statistical distance
between (k, fun i => hash k (s i)) and the uniform distribution on Seed × (ι → Output) is at
most |ι| * √(|Output| * γ + α) / 2.
Multi-sample leftover hash lemma for universal families (α = 0): hashing independent
samples under one shared public seed is within
∑ i, √(|Output| * collisionProbability (source i)) / 2 of the seed paired with an independent
uniform tuple.
Multi-sample leftover hash lemma for universal families (α = 0) under a pointwise
guessing-probability bound γ on each sample.