Documentation

Complexity.Crypto.Computational.Pseudoentropy.ThreeSource.Candidates

Expanding candidates from a pseudoentropy pair #

Each entropy-grid entry defines a deterministic polynomial-time expander with its exact seed length. One entry is secure against every uniform indexed test; its index may vary arbitrarily with the security parameter. The family is indexed by the whole finite grid and never computes entropy.

These raw candidates have different seed lengths. ThreeSource.Padding gives them a common seed length and one bit of stretch. Amplification and XOR combination are still needed to turn them into one generator.

Main definitions #

Main results #

References #

Adapted from the cslib crypto branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8.

def Cslib.Crypto.Pseudoentropy.EntropyGrid.seedLength (n sourceBits observationBound densityBound index : ℕ) :

The exact seed length of a candidate, including all three public matrix keys.

Instances For
    def Cslib.Crypto.Pseudoentropy.EntropyGrid.outputLength (n sourceBits observationBound densityBound index : ℕ) :

    The candidate's output keeps every matrix key and the three digests.

    Instances For
      def Cslib.Crypto.Pseudoentropy.EntropyGrid.generate (n sourceBits observationBound densityBound index : ℕ) (evaluate : List Bool → List Bool × Bool) (seed : List Bool) :

      A candidate is the deterministic three-source extractor at one entropy guess.

      Instances For

        The exact input size is uniformly available in unary.

        The exact output size is uniformly available in unary.

        Candidate evaluation is uniformly polynomial time, with an ordinary captured callback.

        A saved sampler gives one efficient evaluator for the entire indexed family.

        theorem Cslib.Crypto.Pseudoentropy.EntropyGrid.seedLength_lt_outputLength (n sourceBits observationBound densityBound index : ℕ) :
        seedLength n sourceBits observationBound densityBound index < outputLength n sourceBits observationBound densityBound index

        The advertised lengths give strict expansion for every entry, even an inaccurate guess.

        theorem Cslib.Crypto.Pseudoentropy.EntropyGrid.length_generate {pair : SamplablePair} (saved : pair.SeedRealization) (n observationBound densityBound index : ℕ) (hbound : ∀ observation ∈ (PMF.map Prod.fst (pair.joint n)).support, ((pair.encode n) observation).length ≤ observationBound) {seed : List Bool} (hseed : seed.length = seedLength n (saved.length n) observationBound densityBound index) :
        (generate n (saved.length n) observationBound densityBound index (saved.evaluate n) seed).length = outputLength n (saved.length n) observationBound densityBound index

        Every correctly sized input has exactly the advertised output length.

        theorem Cslib.Crypto.Pseudoentropy.EntropyGrid.exists_valid_choice {pair : SamplablePair} {gap : ℕ → ℝ} (hpair : pair.HasGap gap) (saved : pair.SeedRealization) {densityBound : ℕ → ℕ} (hgap : ∀ᶠ (n : ℕ) in Filter.atTop, 4 / ↑(Probability.dyadicSize (densityBound n)) ≤ gap n) :
        ∃ (choose : ℕ → ℕ), ∀ᶠ (n : ℕ) in Filter.atTop, Valid n (saved.length n) (densityBound n) (choose n) (Probability.PMF.entropy (PMF.map Prod.fst (pair.joint n))) (Probability.PMF.conditionalEntropy (pair.joint n)) (gap n)

        Every sufficiently fine grid contains a valid entry, with no entropy estimation required.

        theorem Cslib.Crypto.Pseudoentropy.EntropyGrid.exists_secure_choice {pair : SamplablePair} {gap : ℕ → ℝ} (hpair : pair.HasGap gap) (saved : pair.SeedRealization) {observationBound densityBound : ℕ → ℕ} (hobservation : Turing.MultiTapeTM.ComputableTidilyInPolyTime observationBound Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hdensity : Turing.MultiTapeTM.ComputableTidilyInPolyTime densityBound Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hfits : ∀ (n : ℕ), ∀ observation ∈ (PMF.map Prod.fst (pair.joint n)).support, ((pair.encode n) observation).length ≤ observationBound n) (hgap : ∀ᶠ (n : ℕ) in Filter.atTop, 4 / ↑(Probability.dyadicSize (densityBound n)) ≤ gap n) :
        ∃ (choose : ℕ → ℕ), (∀ᶠ (n : ℕ) in Filter.atTop, choose n < size (saved.length n) (densityBound n)) ∧ ∀ (test : ℕ → ℕ → List Bool → ProbComp Bool), (Probability.IsPPTOn (Turing.MultiTapeTM.encPair (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool fun (input : (ℕ × ℕ) × List Bool) => test input.1.1 input.1.2 input.2) → Negligible fun (n : ℕ) => Game.advantage ((PMF.map (generate n (saved.length n) (observationBound n) (densityBound n) (choose n) (saved.evaluate n)) (BitString.uniformList (seedLength n (saved.length n) (observationBound n) (densityBound n) (choose n)))).bind fun (word : List Bool) => (test n (choose n) word).eval) ((BitString.uniformList (outputLength n (saved.length n) (observationBound n) (densityBound n) (choose n))).bind fun (word : List Bool) => (test n (choose n) word).eval)

        A single varying candidate is secure against every uniform indexed test. The choice is made before the test is quantified and is used only in the proof, never by generate.

        A linear grid precision suffices for the gap already obtained from a general one-way function. This is a numerical consequence of rounding the denominator up to a power of two.