Birthday distinguisher against a block cipher as a PRF #
This module formalizes the non-adaptive collision-testing distinguisher of Boneh–Shoup (§4.4.3,
printed p. 134) that separates any block cipher E : Key → Equiv.Perm D from a uniform random
function D → D in the finite-type PRF experiment (Cslib.Crypto.PRF.advantage):
Cslib.Crypto.PRP.birthdayDistinguisher xqueries a tuplex : Fin Q → Dand outputstrueiff the oracle's answers fail to be injective. It makesQqueries (isQueryBounded_birthdayDistinguisher). Whenxis injective, the real block-cipher experiment always outputsfalse(eval_realExperiment_birthdayDistinguisher), so the PRF advantage equals the collision probability ofQindependent uniform samples fromD:1 - (Fintype.card D).descFactorial Q / (Fintype.card D : ℝ) ^ Q(coe_advantage_birthdayDistinguisher), which is at leastmin (Q * (Q - 1) / (4 * Fintype.card D)) 0.63(min_le_advantage_birthdayDistinguisher). WhenxenumeratesD(Function.Bijective x) and2 ≤ Fintype.card D, the advantage is at least1 / 2(half_le_advantage_birthdayDistinguisher_of_bijective).
Differences from [BS23] #
- The book's adversary makes
Qdistinct queries. Here they are a tuplex : Fin Q → DwithFunction.Injective x, which forcesQ ≤ Fintype.card D. - The distinguisher outputs
decide (¬ Function.Injective y)rather than searching explicitly for a pairi ≠ jwithy i = y j, which is logically equivalent. - For the full-domain distinguisher (
Nqueries), the book implicitly assumesN ≥ 2when claiming1 - N! / N^N ≥ 1 / 2(atN = 1,1 - 1! / 1^1 = 0). Here2 ≤ Fintype.card Dis explicit inhalf_le_advantage_birthdayDistinguisher_of_bijective. - Statements are finite-type with oracle query bounds (
ProbOracleComp.IsQueryBounded); no running time in a machine model is tracked, and the counter-mode attack of §4.4.4.1 is not included.
Main definitions #
Cslib.Crypto.PRP.birthdayDistinguisher: non-adaptiveQ-query collision distinguisher.
Main results #
Cslib.Crypto.PRP.isQueryBounded_birthdayDistinguisher:birthdayDistinguisher xmakes at mostQqueries.Cslib.Crypto.PRP.eval_realExperiment_birthdayDistinguisher: zero collision probability against any permutation cipher whenxis injective.Cslib.Crypto.PRP.succProbability_idealExperiment_birthdayDistinguisher: exact collision probability inPRF.idealExperiment.Cslib.Crypto.PRP.coe_advantage_birthdayDistinguisher: exact PRF advantage1 - (|D|)_Q / |D|^Q.Cslib.Crypto.PRP.min_le_advantage_birthdayDistinguisher: lower boundmin (Q * (Q - 1) / (4 * |D|)) 0.63 ≤ PRF.advantage.Cslib.Crypto.PRP.half_le_advantage_birthdayDistinguisher_of_bijective:1 / 2lower bound wheneverFunction.Bijective xand2 ≤ |D|.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, §4.4.3 (printed p. 134).
Birthday distinguisher of Boneh–Shoup (§4.4.3, printed p. 134): given Q inputs
x : Fin Q → D, it queries the PRF oracle at x 0, …, x (Q - 1) and returns true iff two
responses collide.
birthdayDistinguisher x makes at most Q oracle queries on every execution path.
Against any deterministic oracle f : D → D, birthdayDistinguisher x returns true iff
f ∘ x fails to be injective.
In Experiment 0 (PRP.realExperiment), any block cipher E : Key → Equiv.Perm D preserves
injectivity of x, so birthdayDistinguisher x outputs false with probability 1.
In Experiment 1 (PRF.idealExperiment), for injective x : Fin Q → D,
birthdayDistinguisher x outputs true with probability 1 - (|D|)_Q / |D|^Q.
Exact PRF distinguishing advantage of birthdayDistinguisher x against any block cipher
E : Key → Equiv.Perm D when x is injective (§4.4.3, printed p. 134): 1 - (|D|)_Q / |D|^Q.
Birthday lower bound on the PRF advantage of birthdayDistinguisher x against any block cipher
E : Key → Equiv.Perm D (§4.4.3, printed p. 134): min (Q * (Q - 1) / (4 * |D|)) 0.63.
A tuple x that enumerates a domain of at least two points gives PRF advantage at least 1 / 2
against any block cipher E : Key → Equiv.Perm D (§4.4.3, printed p. 134): the advantage is
1 - |D|! / |D|^|D|.