Documentation

Complexity.Crypto.Computational.GGM.Hybrid

The GGM prefix hybrids #

At level depth, sample an independent label for each newly queried prefix of that length. Remember it for later queries with the same prefix, and evaluate the remaining suffix using the generator. Malformed queries receive the empty word, as in the PRF games.

The cache is an ordinary list. One call preserves a label-width invariant and adds at most one entry. The shared stateful interpreter certifies the entire adaptive game, including copying, sampling, replies and growing storage. This module identifies the endpoint games; adjacent-hybrid security requires a further reduction.

Main definitions #

Main results #

References #

Adapts Crypto/Computational/GGM/Hybrid.lean on the cslib crypto branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8 to the shared typed interpreter.

@[reducible, inline]

A finite collection of queried prefixes and their sampled labels.

Instances For

    Charge every stored prefix and label, including list and pair delimiters.

    Instances For
      noncomputable def Cslib.Crypto.GGM.frontierOracle (generator : List Bool → List Bool) (n depth : ℕ) (query : List Bool) :

      Answer from a cached random label at the chosen level, followed by ordinary tree evaluation.

      Instances For
        noncomputable def Cslib.Crypto.GGM.hybridGame (generator : List Bool → List Bool) (adversary : OracleDistinguisher) (n depth : ℕ) :

        The adaptive hybrid game starts with an empty prefix cache.

        Instances For
          theorem Cslib.Crypto.GGM.hybridGame_zero (generator : List Bool → List Bool) (adversary : OracleDistinguisher) (n : ℕ) :
          (hybridGame generator adversary n 0).eval = (prfRealGame (eval generator) adversary n).eval

          At level zero, all valid queries share one root label. Sampling that label on demand agrees with choosing the key at the start of the real PRF game, even if there are no valid queries.

          The final level caches full query answers directly. There is no suffix left to evaluate.

          theorem Cslib.Crypto.GGM.hybridGame_self (generator : List Bool → List Bool) (adversary : OracleDistinguisher) (n : ℕ) :
          (hybridGame generator adversary n n).eval = (prfIdealGame adversary n).eval

          At the final level, the prefix hybrid is exactly the ideal PRF game.

          theorem Cslib.Crypto.GGM.frontierOracle_bounds (generator : List Bool → List Bool) (n depth : ℕ) (query : List Bool) (cache : Cache) (hcache : ∀ entry ∈ cache, entry.2.length ≤ n) (result : List Bool × Cache) (hresult : result ∈ (frontierOracle generator n depth query cache).eval.support) :
          (∀ entry ∈ result.2, entry.2.length ≤ n) ∧ result.1.length ≤ n ∧ (cacheEncoding result.2).length ≤ (cacheEncoding cache).length + 4 * query.length + 2 * n + 3

          Each call preserves label widths and adds at most one encoded entry. Key lengths and duplicate cache keys are unrestricted; only cached label widths are constrained.

          Certify a prefix call written with computed parameters, query and full cache.

          A uniform adversary's complete adaptive prefix game is strict PPT, uniformly over the chosen level. The local invariant accounts for every reply and all added encoded storage.