Documentation

CslibFrontier.Crypto.Computational.FarIndistinguishable

Statistically far yet computationally indistinguishable ensembles #

Computational indistinguishability is strictly weaker than statistical closeness. Pseudorandom generators and hard-core predicates both give polynomial-time constructible ensembles that no efficient test tells apart although they are statistically far apart [Gol07c], Section 8.2.3.2 and Exercises 8.7 and 8.8.

Polynomial-time constructibility follows [Gol07c], Section 8.2.3.3: one probabilistic polynomial-time sampler S with S(1ⁿ) distributed as the n-th member. It is stated as in Cslib.Crypto.ComputationallyIndistinguishable.replicate_bind, by samplers ℕ → ProbComp (List Bool) that are IsPPTOn encUnary encBits. Statistical distance is Cslib.Probability.CloseTo: CloseTo μ ν ε says the variation distance is at most ε. The headlines prove distance at least 1 / 2 at every n. The draft's "statistically far apart" (Exercise 8.9: distance greater than 1 / p(n) for a positive polynomial p and all large n) follows with p = 3.

Main results #

References #

Support size bounds the distance from uniform #

A word function of n-bit seeds is far from uniform on m bits: its output on a uniform seed takes at most 2 ^ n values, so its statistical distance from a uniform m-bit word is at least 1 - 2 ^ n / 2 ^ m. This is the guideline of [Gol07c], Exercise 8.7.

Pseudorandom generators give far yet indistinguishable ensembles ([Gol07c], Exercise 8.7): the generator's output on a uniform seed and a uniform word of the output length have polynomial-time samplers and are computationally indistinguishable, yet their statistical distance is at least 1 - 2 ^ (n - ℓ(n)) ≥ 1 / 2 at every seed length n.

Hiding one bit of a one-to-one image #

theorem Cslib.Crypto.closeTo_generatorEnsemble_hardCoreIdeal_iff {f : List Bool → List Bool} (predicate : List Bool → Bool) {n : ℕ} (hf : Set.InjOn f {seed : List Bool | seed.length = n}) {ε : ENNReal} :
Probability.CloseTo (generatorEnsemble (fun (seed : List Bool) => f seed ++ [predicate seed]) n) (hardCoreIdeal f n) ε ↔ 1 / 2 ≤ ε

Hiding the bit of a one-to-one image moves the law by exactly 1 / 2: if f is one-to-one on n-bit words, then f(x) b(x) and f(x) σ, for a uniform n-bit x and an independent fair bit σ, are at statistical distance exactly 1 / 2, for every predicate b ([Gol07c], Exercise 8.8). The word f(x) b(x) determines b(x), so the event that the last bit is the predicate of the preimage has probability 1 and 1 / 2.

One-to-one one-way functions give far yet indistinguishable ensembles ([Gol07c], Exercise 8.8): for a one-to-one one-way f, the padded function g(x, r) = (f(x), r) is one-to-one with the Goldreich–Levin hard core b(x, r) = ⟨x, r⟩ ([Gol07c], Theorem 7.7; GoldreichLevin.padded_hardCore). The ensembles g(Uₙ) b(Uₙ) and g(Uₙ) U₁ have polynomial-time samplers and are computationally indistinguishable, yet at statistical distance exactly 1 / 2 at every n.