Documentation

CslibFrontier.Crypto.Computational.Pseudoentropy.ThreeSource.Padding

A common seed length for the entropy grid #

One polynomial bounds the input sizes of all entropy-grid entries. Padding to that common length gives each candidate exactly one bit of stretch and preserves the secure choice against tests that read the advice and the index. The common length is increasing and at least the security parameter plus one, preparing later reindexing by the actual seed length.

Main definitions #

Main results #

References #

This supplies the common-length candidate family used before amplification and XOR in Thomas Holenstein, Pseudorandom Generators from One-Way Functions: A Simple Construction for Any Hardness, TCC 2006, Section 5, final proof of Theorem 1, [Hol06].

Adapted from the cslib crypto branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8.

theorem Cslib.Crypto.Pseudoentropy.EntropyGrid.exists_common_seedLength {sourceBits observationBound densityBound : ℕ → ℕ} (hsource : Turing.MultiTapeTM.ComputableInPolyTime sourceBits Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hobservation : Turing.MultiTapeTM.ComputableInPolyTime observationBound Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) (hdensity : Turing.MultiTapeTM.ComputableInPolyTime densityBound Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) :
∃ (common : ℕ → ℕ), Turing.MultiTapeTM.ComputableInPolyTime common Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary ∧ StrictMono common ∧ (∀ (n : ℕ), n + 1 ≤ common n) ∧ ∀ (n index : ℕ), index < size (sourceBits n) (densityBound n) → seedLength n (sourceBits n) (observationBound n) (densityBound n) index ≤ common n

The entire grid fits one efficient increasing seed-length schedule.

structure Cslib.Crypto.Pseudoentropy.EntropyGrid.PaddingBounds {pair : SamplablePair} (saved : pair.SeedRealization) (observationBound densityBound common : ℕ → ℕ) :

Efficient observation, entropy-resolution and common seed-length bounds for padding the entropy grid. The observation bound applies only on support; the seed bound covers every grid entry. Security assumptions and the entropy gap remain separate.

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

Normalize every grid entry to a chosen common seed length and one bit of stretch.

The padded family uses the same saved sampler and ordinary word operations.

theorem Cslib.Crypto.Pseudoentropy.EntropyGrid.length_paddedGenerate {pair : SamplablePair} (saved : pair.SeedRealization) (n observationBound densityBound commonBits index : ℕ) (hfits : ∀ observation ∈ (PMF.map Prod.fst (pair.joint n)).support, ((pair.encode n) observation).length ≤ observationBound) (hcommon : seedLength n (saved.length n) observationBound densityBound index ≤ commonBits) {seed : List Bool} (hseed : seed.length = commonBits) :
(paddedGenerate n (saved.length n) observationBound densityBound commonBits index (saved.evaluate n) seed).length = commonBits + 1

Correctly sized common inputs give exactly one bit of stretch.

theorem Cslib.Crypto.Pseudoentropy.EntropyGrid.exists_secure_padded_choice_withAdvice {pair : SamplablePair} {gap : ℕ → ℝ} {advice : ℕ → List Bool} (hpair : pair.HasGapWithAdvice gap advice) (saved : pair.SeedRealization) {observationBound densityBound common : ℕ → ℕ} (bounds : PaddingBounds saved observationBound densityBound common) (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)) ∧ IndistinguishableWithAdvice (fun (n : ℕ) => (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encUnary) (advice n, choose n)) (fun (n : ℕ) => PMF.map (paddedGenerate n (saved.length n) (observationBound n) (densityBound n) (common n) (choose n) (saved.evaluate n)) (BitString.uniformList (common n))) fun (n : ℕ) => BitString.uniformList (common n + 1)

Padding preserves one secure choice relative to fixed advice: the padded candidate is indistinguishable from uniform for tests that read both the advice and the candidate index.