Documentation

Complexity.Crypto.Computational.GoldreichLevin.WordReduction

The uniform Goldreich–Levin inverter #

One functional program samples a sign, a saved predictor seed and independent mask bits, then runs the certified word decoder. Its saved evaluator is typed: it receives the parameter and auxiliary word directly and returns a Boolean. No raw output decoding is exposed to the caller.

The same seed is reused for every query at a given image. Its length accounts for the actual pair encoding: an n-bit query appended to the image has encoded input length 3 * n + image.length + 1. Images may have arbitrary lengths. Every fixed precision degree selects one uniform PPT inverter across all security parameters.

Main definitions #

Main results #

References #

Adapted from Crypto/Computational/GoldreichLevin/WordReduction.lean on the cslib crypto branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8, using typed saved seeds and the tidy TM calculus.

The saved tape covers the unary parameter, the whole image and an n-bit query.

Instances For
    def Cslib.Crypto.GoldreichLevin.fixedPredictor (evaluate : ℕ × List Bool → List Bool → Bool) (c d n : ℕ) (image : List Bool) (coins : BitString (coinBudget c d n image.length)) (query : BitString n) :

    Evaluate a parity query with the same saved private seed throughout the reduction.

    Instances For

      Predict a uniform inner product from an image and an independent uniform query.

      Instances For
        noncomputable def Cslib.Crypto.GoldreichLevin.wordInverter (f : List Bool → List Bool) (evaluate : ℕ × List Bool → List Bool → Bool) (c d degree : ℕ) :

        Sample one sign, one predictor seed and independent masks, then decode and check candidates.

        Instances For
          theorem Cslib.Crypto.GoldreichLevin.wordInverter_eval (f : List Bool → List Bool) (evaluate : ℕ × List Bool → List Bool → Bool) (c d degree n : ℕ) (image : List Bool) :
          (wordInverter f evaluate c d degree n image).eval = PMF.map List.ofFn (invertSigned (fun (bits : BitString n) => f (List.ofFn bits)) (fixedPredictor evaluate c d n) (fun (image : List Bool) => Probability.PMF.uniformOfFintype (BitString (coinBudget c d n image.length))) (maskCount n (precision degree n)) image)

          At every image length, the program realizes exactly the finite seeded inverter.

          theorem Cslib.Crypto.GoldreichLevin.fixedPredictor_distribution (adversary : Distinguisher) (evaluate : ℕ × List Bool → List Bool → Bool) (c d : ℕ) (hrealize : ∀ (n : ℕ) (input : List Bool), (adversary n input).eval = PMF.map (evaluate (n, input)) (BitString.uniformList (c * (((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encBits) (n, input)).length + 1) ^ d))) (n : ℕ) (image : List Bool) (query : BitString n) :
          PMF.map (fun (coins : BitString (coinBudget c d n image.length)) => fixedPredictor evaluate c d n image coins query) (Probability.PMF.uniformOfFintype (BitString (coinBudget c d n image.length))) = (adversary n (image ++ List.ofFn query)).eval

          Saved-seed evaluation has the right prediction law for images of any length.

          theorem Cslib.Crypto.GoldreichLevin.eval_parityPredictionGame (f : List Bool → List Bool) (adversary : Distinguisher) (evaluate : ℕ × List Bool → List Bool → Bool) (c d : ℕ) (hrealize : ∀ (n : ℕ) (input : List Bool), (adversary n input).eval = PMF.map (evaluate (n, input)) (BitString.uniformList (c * (((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encBits) (n, input)).length + 1) ^ d))) (n : ℕ) :
          (parityPredictionGame f adversary n).eval = predictionExperiment (fun (bits : BitString n) => f (List.ofFn bits)) (fixedPredictor evaluate c d n) fun (image : List Bool) => Probability.PMF.uniformOfFintype (BitString (coinBudget c d n image.length))

          The prediction game is exactly the finite experiment with an image-dependent saved seed.

          theorem Cslib.Crypto.GoldreichLevin.eval_wordInversionGame (f : List Bool → List Bool) (evaluate : ℕ × List Bool → List Bool → Bool) (c d degree n : ℕ) :
          (inversionGame f (wordInverter f evaluate c d degree) n).eval = inversionExperiment (fun (bits : BitString n) => f (List.ofFn bits)) (invertSigned (fun (bits : BitString n) => f (List.ofFn bits)) (fixedPredictor evaluate c d n) (fun (image : List Bool) => Probability.PMF.uniformOfFintype (BitString (coinBudget c d n image.length))) (maskCount n (precision degree n)))

          The standard any-preimage game agrees with the finite inversion experiment.

          theorem Cslib.Crypto.GoldreichLevin.word_prediction_advantage_le (f : List Bool → List Bool) (adversary : Distinguisher) (evaluate : ℕ × List Bool → List Bool → Bool) (c d : ℕ) (hrealize : ∀ (n : ℕ) (input : List Bool), (adversary n input).eval = PMF.map (evaluate (n, input)) (BitString.uniformList (c * (((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encBits) (n, input)).length + 1) ^ d))) (degree n : ℕ) :
          |((parityPredictionGame f adversary n).eval true).toReal - 1 / 2| ≤ 1 / ↑(precision degree n) + 8 * ((inversionGame f (wordInverter f evaluate c d degree) n).eval true).toReal

          Prediction bias is at most the precision error plus eight times inversion success.

          No uniform PPT adversary predicts a masked inner product of a one-way input with nonnegligible bias. Each precision degree selects one inverter for all lengths.

          One efficient typed evaluator witnesses the concrete reduction at every precision degree. When f is efficient, isPPT_wordInverter certifies each resulting inverter.