Collisions of a function on uniform samples #
For a function f : M → β whose values lie in a finite set D, and s independent uniform
samples x : Fin s → M, this module bounds from below the probability that two samples are
different points with the same value under f:
1 - exp (-s (s - 1) / (2 |D|)) - C(s, 2) / |M| ≤ P(∃ i j, f (x i) = f (x j) ∧ x i ≠ x j).
This is the probabilistic content of [BS23], §8.3, Lemma 8.2 (printed p. 294), with its
two error terms kept explicit. The first term is Theorem B.1(i) for the pushforward law of the
values, which is not uniform in general; the proof applies
Cslib.Probability.PMF.one_sub_exp_neg_le_iid_not_injective, which holds for every law. The second
term bounds the probability that two samples are the same point, by the union bound
Cslib.Probability.PMF.iid_not_injective_le.
Differences from [BS23] #
- Lemma 8.2 is stated for a hash function
H : M → TwithN = |T|. Herefis any function with values in a finite setD, and|D|plays the part ofN. - The book bounds the probability that two samples are equal messages by Theorem B.1(ii), which
gives at most
1/5for its parameters. Here the union boundC(s, 2) / |M|is used. It needs no side condition, and for the book's parameters it is at most0.06. - The book's constants are
3/4 - 1/5 > 1/2. Here they are1 - 1/4 - 1/8 ≥ 1/2.
Main results #
Cslib.Probability.PMF.one_sub_exp_neg_sub_choose_le_iid_uniformOfFintype_exists_collision: the lower bound displayed above.Cslib.Probability.PMF.half_le_one_sub_exp_neg_sub_choose_of_hundred_mul_le: with the book's parameters|M| ≥ 100 Nands = ⌈2 √N⌉ + 1, the bound is at least1/2.Cslib.Probability.PMF.one_eighth_le_iid_uniformOfFintype_exists_collision: for a range bound of sizeN ≥ 16and|M| ≥ N², the collision probability is at least1/8after⌊√N⌋draws.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, §8.3, Lemma 8.2 and Algorithm BirthdayAttack (printed pp. 294–295); Appendix B.1, Theorem B.1 (printed p. 1101).
Collisions of a function on uniform samples (the probabilistic content of
[BS23], §8.3, Lemma 8.2, printed p. 294, with explicit error terms): if every value of
f lies in the finite set D, then among s independent uniform samples two are different points
with the same value of f with probability at least
1 - exp (-s (s - 1) / (2 |D|)) - C(s, 2) / |M|.
The parameters of Lemma 8.2 ([BS23], §8.3, Algorithm BirthdayAttack, printed
p. 294): for K ≥ 100 N and s = ⌈2 √N⌉ + 1,
1/2 ≤ 1 - exp (-s (s - 1) / (2 N)) - C(s, 2) / K. With r = ⌈2 √N⌉, 4 N ≤ r (r + 1) ≤ 12 N.
If a function's values lie in a set D of size at least 16 and its domain has at least
|D|² points, ⌊√|D|⌋ independent uniform draws contain two distinct points with the same
value with probability at least 1/8.