Documentation

CslibFrontier.Crypto.Computational.PseudorandomFunction.RandomOracle

An executable finite-list oracle for the PRF ideal game #

Valid queries are memoized as ordinary words via Cslib.Probability.cachedSamplerOracle. Malformed queries receive the empty word and retain the cache. Injective key representations and the shared eager/lazy theorem identify this program with the length-preserving ideal PRF game prfIdealGame id id for every randomized adaptive adversary.

Main results #

References #

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

theorem Cslib.Crypto.prfIdealGame_eq_cached (adversary : OracleDistinguisher) (n : ℕ) :
(prfIdealGame id id adversary n).eval = (Prod.fst <$> (OracleComp.interpret (OracleComp.sumHandler (fun (k : ℕ) => StateT.lift (ProbComp.unifFin k)) fun (request : Unit × List Bool) => cachedRandomFunctionOracle (fun (x : List Bool) => x.length == n) n request.2) (adversary n [])).run []).eval

An executable list cache realizes the ideal experiment, preserving repeated-query consistency and independent private randomness under arbitrary adaptive interaction.

The ideal experiment has a strict PPT realization through its lazy cache. This does not construct the exponentially large eager table; the entire adaptive interaction is certified.