Documentation

Complexity.Crypto.Computational.PseudorandomFunction

Uniform computational pseudorandom functions #

Keys, valid queries and answers have length n. An adversary receives the unary security parameter, independent private randomness and adaptive access to one word channel. The real game samples one key; the ideal game samples one whole function and reuses it across calls. Both games invoke the adversary with empty auxiliary input and reject malformed queries with the empty word. The table is a semantic specification; RandomOracle certifies a lazy realization of the same law for oracle-PPT adversaries.

The keyed evaluator has a uniform deterministic TM certificate on the encoded key/query pair. Admissible adversaries satisfy IsOraclePPT, charging ordinary computation and request writing, with one machine and polynomial for all parameters and auxiliary inputs.

Main definitions #

Main results #

References #

Adapted from Crypto/Computational/PseudorandomFunction.lean on the cslib crypto branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8, using the shared typed interpreter and word channel.

@[reducible, inline]

An adaptive test with a unary parameter, an auxiliary word and one external word channel.

Instances For
    def Cslib.Crypto.prfOracle (family : List Bool → List Bool → List Bool) (n : ℕ) (key query : List Bool) :

    A keyed oracle rejects queries outside the declared domain.

    Instances For

      Read a fixed random table, rejecting malformed words before interpreting their bits.

      Instances For

        Adapt a valid word to the finite domain. Malformed words make no external call.

        Instances For
          theorem Cslib.Crypto.interpret_randomFunctionQuery {m : Type → Type u_1} [Monad m] [LawfulMonad m] (random : (n : ℕ) → m (Fin (n + 1))) (n : ℕ) (table : BitString n → BitString n) (query : List Bool) :
          OracleComp.interpret (ProbOracleComp.handler random fun (bits : BitString n) => pure (table bits)) (randomFunctionQuery n query) = pure (randomFunctionOracle n table query)

          The finite query adapter preserves the word-valued table interface in every lawful monad.

          A semantic random-function cache, retaining only the finite-domain answers already used.

          Instances For
            noncomputable def Cslib.Crypto.prfRealGame (family : List Bool → List Bool → List Bool) (adversary : OracleDistinguisher) (n : ℕ) :

            Sample one key and reuse it across every adaptive call.

            Instances For
              noncomputable def Cslib.Crypto.prfIdealGame (adversary : OracleDistinguisher) (n : ℕ) :

              Sample one whole random function, independently of the adversary's private samples.

              Instances For
                theorem Cslib.Crypto.prfIdealGame_eq_lazy (adversary : OracleDistinguisher) (n : ℕ) :
                (prfIdealGame adversary n).eval = PMF.map Prod.fst ((OracleComp.interpret (ProbOracleComp.handler (fun (k : ℕ) => StateT.lift (ProbComp.unifOracle k)) fun (request : Unit × List Bool) => lazyRandomFunctionOracle n request.2) (adversary n [])).run fun (x : BitString n) => none)

                The ideal game admits consistent lazy answers to adaptive queries, with private randomness independent of the table and the same rejection convention for malformed inputs.

                A keyed family evaluated in plain polynomial time, secure against every uniform adaptive oracle test.

                Instances For

                  Recover the tidy presentation for proofs without changing the security contract.