Bijection PRG: Perfect Security #
A pseudorandom generator that is a bijection from seeds to outputs has perfect security. Following Rosulek, The Joy of Cryptography, §5 (pseudorandom generators).
If the stretch map s ↦ stretch s is a bijection from the seed space onto the
output space, then over a uniform seed the generator output is itself uniform on
the output space. Hence the PRG real game (stretch a uniform seed) and the PRG
ideal game (a fresh uniform output) are perfectly indistinguishable: the PRG
advantage of every adversary is exactly 0.
Overview #
This mirrors the one-time-pad and bijection-PRF arguments
(CatCrypt.Examples.OTP, CatCrypt.Examples.PRF): the security proof is the
bijection-coupling technique. liftR_uniform_bij couples the uniform seed with
the uniform output through the bijection bij : Seed ≃ Output;
liftR_bind/liftR_pure push the coupling through the sample-then-pure
structure of the real game; and PRG_Adv_zero_of_rHoare collapses the advantage
to 0.
A bijection forces |Seed| = |Output|, so a bijection generator is not
length-extending. This is the information-theoretic boundary of Rosulek §5: a
genuinely length-extending PRG has an image that is a vanishing subset of the
output space, so it can only be computationally secure. The corresponding
reduction — the triple-from-double bound Adv(G₃) ≤ 2·Adv(G) — is proved
computationally elsewhere (CatCrypt.Examples.TriplePRG).
Main definitions #
PRGScheme— a length-preserving/extending generatorstretch : Seed → Output.PRG_Real/PRG_Ideal/PRG_Adv— the PRG distinguishing game and advantage.BijPRG— a seed→output bijection.BijPRG.toPRGScheme— thePRGSchemeit induces (stretch s = bij s).
Main results #
PRG_Adv_zero_of_rHoare— a perfectly-indistinguishable PRG has advantage0.bijPRG_coupling— the real and ideal PRG games couple witheqPost.bijPRG_perfect— a bijection PRG has perfect security:PRG_Adv B.toPRGScheme A = 0for every adversaryA.
References #
- [Rosulek, The Joy of Cryptography, §5 (pseudorandom generators)]
PRG Scheme and Game #
PRG real game: stretch a uniformly random seed.
Equations
- CatCrypt.Examples.PRG.PRG_Real G = do let s ← CatCrypt.Core.SPComp.sample G.Seed CatCrypt.Core.SPComp.pure (G.stretch s)
Instances For
PRG ideal game: return a uniformly random output.
Instances For
PRG advantage: distinguishing the stretched seed from a uniform output.
Equations
Instances For
If a PRG's real game is perfectly indistinguishable from the ideal game, the
PRG advantage is 0 for every adversary.
Bijection PRG #
Perfect Security #
Coupling: for a bijection PRG the real and ideal games are equidistributed.
Over a uniform seed s, the real game returns bij s while the ideal game
returns a fresh uniform output r; liftR_uniform_bij B.bij couples them so
that bij s = r, so the two games agree pointwise.
A bijection PRG has perfect security: every adversary has PRG advantage
exactly 0.
Example: the XOR PRG over Bool #
G(s) = s ⊕ c for a fixed mask c is the bijection boolXorBij c; it is a
(non-extending) bijection generator and inherits perfect security.
The XOR generator over Bool as a bijection PRG: bij = boolXorBij c.
Equations
- CatCrypt.Examples.PRG.boolXorPRG c = { Seed := Bool, Output := Bool, finSeed := Bool.fintype, neSeed := ⋯, finOutput := Bool.fintype, neOutput := ⋯, bij := CatCrypt.Prob.XorBij.boolXorBij c }
Instances For
The XOR generator over Bool has perfect PRG security.
PRG security assumption #
The bijection results above are perfect (ε = 0). A genuinely length-extending
generator can only be computationally secure, so the reduction below takes the
base generator's security as a hypothesis. PRGAssumption is the PRG analogue of
CatCrypt.Crypto.PRFAssumption: it packages the standard "G is an ε-secure
PRG" hypothesis that reductions consume.
The packaged advantage bound of a PRG assumption.
A perfectly secure PRG (every adversary has advantage exactly 0) satisfies
the PRG assumption with ε = 0.
Equations
- CatCrypt.Examples.PRG.PRGAssumption.of_perfect G h = { ε := 0, bound := ⋯ }
Instances For
bind_vcgen witness for the ε = 0 case #
For a bijection PRG the real and ideal games are the same SPComp
distribution. We discharge this exact hop with the bind_vcgen
run-to-completion tactic: through the supplied change-of-variables bijection
B.bij it collapses sample s; return bij s to a fresh uniform sample. This is
the perfect (ε = 0) base case that instantiates PRGAssumption.
The real and ideal PRG games for a bijection PRG are the same SPComp
computation. Proved by bind_vcgen using B.bij: the change-of-variables through
the bijection rewrites the stretched seed into a plain uniform sample.
A bijection PRG has PRG advantage 0, re-proved through the bind_vcgen
game-equality bijPRG_game_eq (an alternative to the relational coupling of
bijPRG_perfect).
A bijection PRG satisfies the PRGAssumption with ε = 0, witnessed by the
bind_vcgen proof bijPRG_adv_zero_via_vcgen.
Equations
Instances For
Triple-from-double PRG: the computational bound #
Given a length-doubling base generator G : Seed → Seed × Seed, the
length-tripling construction
`G₃(s) = let (a, b) := G(s); let (c, d) := G(a); (c, d, b)`
satisfies Adv_PRG(G₃) ≤ 2·ε under a PRG-security assumption on G (Rosulek,
The Joy of Cryptography, §5.3). This mirrors the cascade-PRF upgrade
(CatCrypt.Examples.PRF.cascade_prf_bound): a computational bound composed from
two named per-hop assumptions via the advantage triangle inequality, keeping the
perfect (ε = 0) corollary.
The reduction runs the decomposed hybrid (Rosulek §5.3), which uses
independent seeds for the two G calls to break their correlation:
| Step | Transition | Bound |
|---|---|---|
| 0→1 | inner G(s₁) (produces c,d) → random | ε (PRG assumption) |
| 1→2 | outer G(s₂).2 (produces b) → random | ε (PRG assumption) |
The hop bounds are the cryptographic hypotheses; the theorem composes them into the total bound by the advantage triangle inequality.
Decomposed hybrid game (independent seeds per G call).
i ≥ 2: everything uniform (idealG₃);i = 1: innerGcall replaced by random, outerGstill real;i = 0: bothGcalls real but with independent seeds.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Hybrid 2 is the ideal G₃: three independent uniform seeds, independent of
the base generator's stretch.
Triple-from-double hybrid bound (the composition core).
For any 3-game hybrid sequence H realising the 2-hop ladder, if both hops are
bounded by ε, then Adv(H₀, H₂) ≤ 2·ε. The composition is the advantage
triangle inequality — the PRG analogue of cascade_prf_bound.
Triple PRG uniform bound: when both decomposed hybrid hops have advantage
at most ε, the triple construction advantage is at most 2·ε.
This is the tight reduction Adv_PRG(G₃) ≤ 2·Adv_PRG(G), mirroring the dev
CatCrypt.Examples.TriplePRG.triple_prg_uniform_bound.
Triple PRG bound from a base-PRG security assumption.
If the inner and outer decomposed hops are bounded by the corresponding base-PRG
advantages (h_inner, h_outer — the reduction's soundness, whose reduction
adversaries Ain/Aout are exposed as hypotheses), and the base generator
satisfies a PRGAssumption on each induced scheme (with Hout.ε ≤ Hin.ε), then
the triple advantage is at most 2·Hin.ε.
Perfect triple corollary. When both hops are perfectly indistinguishable
(ε = 0, e.g. a bijection base generator via bijPRG_assumption), the triple
advantage is exactly 0.