Documentation

CslibFrontier.Crypto.Computational.PseudorandomFunction.PrefixHybrid

Prefix hybrids for word PRFs #

A query uses a memoized uniform label at the chosen prefix length and evaluates the remaining suffix from that label. A query shorter than the cut uses its own label. These experiments are shared by the binary GGM tree and the arbitrary block-width cascade. At cut zero the label is the real key. Once the cut covers the domain, labels are the ideal oracle replies if evaluation on an empty suffix returns the label itself.

noncomputable def Cslib.Crypto.prefixHybridOracle (valid : List Bool → Bool) (family : List Bool → List Bool → List Bool) (n cut : ℕ) (query : List Bool) :

Answer a valid query by sampling a label once at its prefix and evaluating the suffix. Invalid queries return the empty word without touching the cache.

noncomputable def Cslib.Crypto.prefixHybridGame (valid : ℕ → List Bool → Bool) (family : List Bool → List Bool → List Bool) (adversary : OracleDistinguisher) (n cut : ℕ) :

Run a distinguisher with a prefix hybrid from an empty cache. The cut counts bits.

theorem Cslib.Crypto.eval_prefixHybridGame_zero (valid : ℕ → List Bool → Bool) (family : List Bool → List Bool → List Bool) (adversary : OracleDistinguisher) (n : ℕ) :
(prefixHybridGame valid family adversary n 0).eval = (prfRealGameOn valid family adversary n).eval

At cut zero every valid query shares the uniform root key of the real game.

theorem Cslib.Crypto.prefixHybridOracle_eq_cachedRandomFunctionOracle {valid : List Bool → Bool} {family : List Bool → List Bool → List Bool} {n cut : ℕ} (hcut : ∀ (query : List Bool), valid query = true → query.length ≤ cut) (hnil : ∀ (seed : List Bool), family seed [] = seed) :

Once the cut covers all valid queries, a cached label is the reply itself.

theorem Cslib.Crypto.prefixHybridOracle_bounds {valid : List Bool → Bool} {family : List Bool → List Bool → List Bool} {n cut : ℕ} (hEval : ∀ (seed suffix : List Bool), seed.length ≤ n → (family seed suffix).length ≤ n) {query : List Bool} {cache : List (List Bool × List Bool)} (hcache : ∀ entry ∈ cache, entry.2.length ≤ n) {result : List Bool × List (List Bool × List Bool)} (hresult : result ∈ (prefixHybridOracle valid family n cut query cache).eval.support) :

Each valid query adds at most one prefix label; malformed queries leave the cache unchanged. The reply bound also holds on cache hits when every stored label has length at most n.

The complete adaptive hybrid is strict PPT, with the security parameter and cut in unary. The output-length bound accounts for all oracle replies and for each stored prefix and label.