Documentation

CslibFrontier.Crypto.Computational.Nonuniform.Basic

Security against adversaries with advice #

Nonuniform security lets every adversary read, besides the unary parameter n and its challenge, an advice word advice n from an arbitrary family whose lengths are polynomially bounded. The adversary itself is still one uniform strict PPT program, clocked on the whole input, including the advice. This is the usual "PPT with polynomial advice" adversary class: the family need not be computable, so it can hard-wire information about every parameter separately.

NonuniformlyIndistinguishable, NonuniformOneWay and NonuniformPRG relativize ComputationallyIndistinguishable, OneWay and PseudorandomGenerator to this class. Each uniform adversary is an advice adversary that ignores empty advice, so every nonuniform notion implies its uniform counterpart. IndistinguishableWithAdvice advice and InversionHardWithAdvice f advice fix one advice family; with empty advice they are exactly the uniform notions, so a reduction proved relative to a fixed family yields both the uniform and the nonuniform theorem. Moreover, an advice word may carry a value of any type under any encoding (IndistinguishableWithAdvice.negligible_encoded, InversionHardWithAdvice.inversion_negligible_encoded): an adversary need not decode its advice, since it may run on the encoded word exactly as on the typed value.

These are definitions, not assertions that such primitives exist.

Main definitions #

Main results #

References #

Two ensembles are indistinguishable with advice advice when each uniform strict PPT test reading the parameter n, the advice word advice n and a sample has negligible advantage. The advice family is not bounded here; its length is charged to the test's clock, which is polynomial in the length of its whole input, including the advice and the sample, as for ComputationallyIndistinguishable: for ensembles of superpolynomial sample length the test gets more than poly(n) time, unlike a polynomial-size circuit. With empty advice this is uniform computational indistinguishability (computationallyIndistinguishable_iff_indistinguishableWithAdvice_nil).

Two ensembles are nonuniformly indistinguishable when they are indistinguishable with every polynomially bounded advice family.

Uniform indistinguishability is the empty-advice case. A uniform test is an advice test that ignores its advice, and an advice test run on empty advice is a uniform test.

Efficient parameter-dependent deterministic postprocessing preserves indistinguishability with advice.

Every ensemble is nonuniformly indistinguishable from itself.

Nonuniform indistinguishability is symmetric.

Nonuniform indistinguishability composes through an intermediate ensemble.

Nonuniform indistinguishability implies uniform indistinguishability: a uniform test ignores empty advice.

theorem Cslib.Crypto.IndistinguishableWithAdvice.negligible_encoded {X Y : ℕ → PMF (List Bool)} {γ : Type} {encAdvice : γ ↪ List Bool} {advice : ℕ → γ} (h : IndistinguishableWithAdvice (fun (n : ℕ) => encAdvice (advice n)) X Y) {test : (ℕ × γ) × List Bool → ProbComp Bool} (htest : Probability.IsPPTOn (encAdvisedInputWith encAdvice) Turing.MultiTapeTM.encBool test) :
Negligible fun (n : ℕ) => (distinguishingGame (X n) fun (word : List Bool) => test ((n, advice n), word)).advantage (distinguishingGame (Y n) fun (word : List Bool) => test ((n, advice n), word))

Advice of any encoded type. Indistinguishability with the advice words encAdvice (advice n) covers every uniform strict PPT test that reads the advice value advice n itself, of an arbitrary type γ under an arbitrary encoding. The test need not be able to decode the advice word: the test is a word test run on that word (Cslib.Probability.IsPPTOn.exists_bool_factor).

theorem Cslib.Crypto.IndistinguishableWithAdvice.of_negligible_encoded {X Y : ℕ → PMF (List Bool)} {γ : Type} {encAdvice : γ ↪ List Bool} {advice : ℕ → γ} (h : ∀ (test : (ℕ × γ) × List Bool → ProbComp Bool), Probability.IsPPTOn (encAdvisedInputWith encAdvice) Turing.MultiTapeTM.encBool test → Negligible fun (n : ℕ) => (distinguishingGame (X n) fun (word : List Bool) => test ((n, advice n), word)).advantage (distinguishingGame (Y n) fun (word : List Bool) => test ((n, advice n), word))) :
IndistinguishableWithAdvice (fun (n : ℕ) => encAdvice (advice n)) X Y

Typed advice tests suffice. The converse of negligible_encoded: if every uniform strict PPT test that reads the advice value advice n itself has negligible advantage, the ensembles are indistinguishable with the advice words encAdvice (advice n). A word test is a typed test that first exposes the encoded advice.

theorem Cslib.Crypto.not_computationallyIndistinguishable_pure_uniformList (target : ℕ → List Bool) {length : ℕ → ℕ} (hlength : ∀ᶠ (n : ℕ) in Filter.atTop, 1 ≤ length n) :
¬ComputationallyIndistinguishable (fun (n : ℕ) => PMF.pure (target n)) fun (n : ℕ) => BitString.uniformList (length n)

Fixed words are distinguishable from uniform words, already by a uniform test: the first bit of PMF.pure (target n) is constant, while that of a uniform word of positive length is a fair coin. This needs no bound on target.

theorem Cslib.Crypto.not_nonuniformlyIndistinguishable_pure_uniformList (target : ℕ → List Bool) {length : ℕ → ℕ} (hlength : ∀ᶠ (n : ℕ) in Filter.atTop, 1 ≤ length n) :
¬NonuniformlyIndistinguishable (fun (n : ℕ) => PMF.pure (target n)) fun (n : ℕ) => BitString.uniformList (length n)

Nonuniform indistinguishability is not trivially true: fixed words are not nonuniformly indistinguishable from uniform words (not_computationallyIndistinguishable_pure_uniformList).

Inversion of f is hard with advice advice when each uniform strict PPT inverter reading the parameter n, the advice word advice n and the image of a uniform n-bit input has negligible probability of finding any preimage. The advice family is not bounded here; its length is charged to the inverter's clock. With empty advice this is the security condition of OneWay (oneWay_iff_inversionHardWithAdvice_nil), that is, of [Gol98], Definition 2.2.1, p. 29; required of every polynomially bounded family, it is the security condition of NonuniformOneWay (Definition 2.2.6, p. 36). One fixed family is not a notion of the source, and a family whose length grows faster than every polynomial also extends the inverter's clock beyond the source's polynomial bounds.

theorem Cslib.Crypto.InversionHardWithAdvice.inversion_negligible {f : List Bool → List Bool} {advice : ℕ → List Bool} (h : InversionHardWithAdvice f advice) (adversary : (ℕ × List Bool) × List Bool → ProbComp (List Bool)) (hPPT : Probability.IsPPTOn encAdvisedInput Turing.MultiTapeTM.encBits adversary) :
Negligible fun (n : ℕ) => Game.succProbability (inversionGame f (fun (n : ℕ) (image : List Bool) => adversary ((n, advice n), image)) n).eval

Each efficient inverter with the given advice has negligible success.

theorem Cslib.Crypto.InversionHardWithAdvice.of_inversion_negligible {f : List Bool → List Bool} {advice : ℕ → List Bool} (h : ∀ (adversary : (ℕ × List Bool) × List Bool → ProbComp (List Bool)), Probability.IsPPTOn encAdvisedInput Turing.MultiTapeTM.encBits adversary → Negligible fun (n : ℕ) => Game.succProbability (inversionGame f (fun (n : ℕ) (image : List Bool) => adversary ((n, advice n), image)) n).eval) :

Establish hardness with advice by bounding every efficient inverter's success probability.

theorem Cslib.Crypto.InversionHardWithAdvice.inversion_negligible_encoded {f : List Bool → List Bool} {γ : Type} {encAdvice : γ ↪ List Bool} {advice : ℕ → γ} (h : InversionHardWithAdvice f fun (n : ℕ) => encAdvice (advice n)) {adversary : (ℕ × γ) × List Bool → ProbComp (List Bool)} (hPPT : Probability.IsPPTOn (encAdvisedInputWith encAdvice) Turing.MultiTapeTM.encBits adversary) :
Negligible fun (n : ℕ) => Game.succProbability (inversionGame f (fun (n : ℕ) (image : List Bool) => adversary ((n, advice n), image)) n).eval

Advice of any encoded type. Hardness with the advice words encAdvice (advice n) covers every uniform strict PPT inverter that reads the advice value advice n itself, of an arbitrary type under an arbitrary encoding.

Uniform one-wayness is the empty-advice case. A uniform inverter is an advice inverter that ignores its advice, and an advice inverter run on empty advice is a uniform inverter.

A function is nonuniformly one-way when one deterministic polynomial-time algorithm evaluates it and inversion is hard with every polynomially bounded advice family.

This is [Gol98], Definition 2.2.6, p. 36, with uniform strict PPT inverters that read a polynomially bounded advice word, charged to their clock, in place of the source's families of polynomial-size circuits. The two give the same notion: fixing an advised inverter's coins to a best choice and writing out its run gives a polynomial-size circuit at each length, as the source's remark after the definition does for uniform inverters, and a circuit's description is polynomially bounded advice for a uniform circuit evaluator. Section 1.3.3, pp. 18–20, of the source describes this correspondence between machines with advice and circuit families.

theorem Cslib.Crypto.NonuniformOneWay.inversion_negligible {f : List Bool → List Bool} (h : NonuniformOneWay f) (adversary : (ℕ × List Bool) × List Bool → ProbComp (List Bool)) (hPPT : Probability.IsPPTOn encAdvisedInput Turing.MultiTapeTM.encBits adversary) {advice : ℕ → List Bool} (hadvice : PolynomiallyBounded fun (n : ℕ) => (advice n).length) :
Negligible fun (n : ℕ) => Game.succProbability (inversionGame f (fun (n : ℕ) (image : List Bool) => adversary ((n, advice n), image)) n).eval

Each efficient inverter with polynomially bounded advice has negligible success.

Establish nonuniform one-wayness by bounding the success probability of every efficient inverter with polynomially bounded advice.

Nonuniform one-wayness implies uniform one-wayness: a uniform inverter ignores empty advice.

structure Cslib.Crypto.NonuniformPRG (generator : List Bool → List Bool) (length : ℕ → ℕ) :

A nonuniform pseudorandom generator: a plain polynomial-time generator with exact output length length, strictly expanding every seed length, whose output on a uniform seed is nonuniformly indistinguishable from a uniform word of the output length.

This is [Gol98], Definition 3.3.2, p. 85, with pseudorandomness against polynomial-size circuits, the indistinguishability that Exercise 8 of Chapter 3, p. 121, defines, in place of probabilistic polynomial-time tests. As for NonuniformOneWay, the circuits are replaced by uniform strict PPT tests reading a polynomially bounded advice word, which give the same notion; fixing a probabilistic test's coins loses no distinguishing gap (Exercise 7 of Chapter 3, p. 121).

theorem Cslib.Crypto.NonuniformPRG.toPRG {generator : List Bool → List Bool} {length : ℕ → ℕ} (h : NonuniformPRG generator length) :
PseudorandomGenerator generator length

A nonuniform pseudorandom generator is a uniform pseudorandom generator.