Documentation

CslibFrontier.Crypto.Computational.PseudorandomFunction.Finite

Word-level pseudorandom functions as finite ones #

At security parameter n, a word family family : List Bool → List Bool → List Bool is a keyed function PRF.atLevel family n on n-bit strings, and a word distinguisher A is a finite PRF adversary (OracleCodec.bitString n).adapt (A n []): it reads n-bit requests as strings and answers other requests with the empty word without a call, which is the convention of the word games. The two views have the same games (PRF.advantage_atLevel_adapt): the finite PRF advantage of the adapted adversary against PRF.atLevel family n is the advantage of A between prfRealGame id family A n and prfIdealGame id id A n, for every length-preserving family.

So a PseudorandomFunction makes the finite advantage of every adapted oracle-PPT distinguisher negligible in n, and an argument about finite PRF adversaries (a hybrid step, a switching lemma, a derived keyed function) transfers to the word notion by exhibiting its finite adversary as an adapted word program.

Main definitions #

Main results #

theorem Cslib.Crypto.wordOracle_bitString {m : Type → Type u_1} [Monad m] [LawfulMonad m] (n : ℕ) (f : BitString n → BitString n) :
((OracleCodec.bitString n).wordOracle fun (x : BitString n) => pure (f x)) = fun (request : Unit × List Bool) => pure (randomFunctionOracle n f request.2)

A table on n-bit strings presents randomFunctionOracle n f on the word channel: through OracleCodec.bitString n, an n-bit request is answered by the bits of the table's value and any other request by the empty word.

def Cslib.Crypto.PRF.atLevel (family : List Bool → List Bool → List Bool) (n : ℕ) (key x : BitString n) :

The keyed function of the word family family at parameter n: an n-bit key and an n-bit query give the first n bits of family key query, padded with false. For a length-preserving family no padding happens.

theorem Cslib.Crypto.PRF.eval_realExperiment_atLevel_adapt {family : List Bool → List Bool → List Bool} (hlength : ∀ (key query : List Bool), query.length = key.length → (family key query).length = key.length) (A : OracleDistinguisher) (n : ℕ) :

For a length-preserving family, the finite real PRF experiment on (OracleCodec.bitString n).adapt (A n []) against PRF.atLevel family n has the same Boolean law as prfRealGame id family A n.

The finite ideal PRF experiment on (OracleCodec.bitString n).adapt (A n []) equals prfIdealGame id id A n.

theorem Cslib.Crypto.PRF.advantage_atLevel_adapt {family : List Bool → List Bool → List Bool} (hlength : ∀ (key query : List Bool), query.length = key.length → (family key query).length = key.length) (A : OracleDistinguisher) (n : ℕ) :

Finite and word PRF games agree. For a length-preserving family, the finite PRF advantage of the adapted word distinguisher against PRF.atLevel family n is the advantage of A between the word games prfRealGame id family A n and prfIdealGame id id A n.