Documentation

CslibFrontier.Crypto.Computational.PseudorandomFunction.MultiKey

Several independent keys of a pseudorandom function #

A pseudorandom function stays pseudorandom when an adversary may query t independently keyed copies at once, for every constant number t of keys. This is a step toward [BS23], Exercise 4.26, not the exercise: the exercise allows any polynomially bounded number of keys, and that statement is open (#5293). The concrete bound holds for every t, but its sum of t hybrid reductions gives the asymptotic statement only for constant t. The real game prfMultiRealGame samples one t * n-bit key and answers channel i : Fin t with the family under the i-th n-bit block keyBlock n i key; the ideal game prfMultiIdealGame answers the channels with t independent uniform random functions.

The proof is the standard hybrid argument. In the j-th hybrid the channels below j are random and the others are keyed. The reduction prfMultiReduction family t j adversary samples its own key, forwards channel j to its PRF challenger, simulates the random channels below j lazily with an ordinary list cache, and evaluates the keyed channels above j itself. Against the real PRF game it is the j-th hybrid and against the ideal PRF game the (j + 1)-st, so the multi-key advantage is at most the sum of the t PRF advantages (advantage_prfMultiRealGame_prfMultiIdealGame_le). The reduction is oracle PPT (isOraclePPT_prfMultiReduction), which gives the asymptotic statement PseudorandomFunction.multiKey_constantCount. Against every table on n-bit strings, the word reduction has the law of the finite reduction PRF.multiKeyReduction of PRF.atLevel family n on the adapted adversary (interpret_prfMultiReduction_eq_multiKeyReduction); both PRF games run it against such a table.

Main definitions #

Main results #

Steps toward Exercise 4.26 #

References #

The i-th block of n bits of a word, that is, its bits i * n to i * n + n - 1.

theorem Cslib.Crypto.length_keyBlock {n t i : ℕ} {key : List Bool} (hkey : key.length = t * n) (hi : i < t) :
(keyBlock n i key).length = n

Blocks of a word of t blocks have exactly n bits.

@[reducible, inline]

An adaptive test with a unary parameter, an auxiliary word and t word channels.

noncomputable def Cslib.Crypto.prfMultiRealGame (family : List Bool → List Bool → List Bool) (t : ℕ) (adversary : MultiKeyDistinguisher t) (n : ℕ) :

The real multi-key experiment: one t * n-bit key, whose i-th block keys channel i.

noncomputable def Cslib.Crypto.prfMultiIdealGame (t : ℕ) (adversary : MultiKeyDistinguisher t) (n : ℕ) :

The ideal multi-key experiment: t independent uniform random functions.

@[reducible, inline]

The cache of the hybrid reduction, keyed by channel and query.

noncomputable def Cslib.Crypto.prfMultiHandler (family : List Bool → List Bool → List Bool) (t j n : ℕ) (key : List Bool) (request : Fin t × List Bool) (cache : MultiKeyCache t) :

One call of the j-th hybrid reduction with its own key. Channels below j are lazily sampled random functions; channel j is forwarded to the external oracle; channels above j are keyed by blocks of key. Replies of the last two kinds are cut at n bits, which changes nothing for keys and replies of the declared lengths and keeps the reduction polynomial on all inputs.

noncomputable def Cslib.Crypto.prfMultiReduction (family : List Bool → List Bool → List Bool) (t j : ℕ) (adversary : MultiKeyDistinguisher t) :

The j-th hybrid reduction: sample a t * n-bit key, then run the multi-key adversary with prfMultiHandler, starting from the empty cache.

Efficiency of the hybrid reduction #

The hybrid reduction is oracle PPT whenever the multi-key adversary is.

Correctness of the hybrid reduction #

theorem Cslib.Crypto.interpret_prfMultiReduction_eq_multiKeyReduction {family : List Bool → List Bool → List Bool} {t : ℕ} (hlength : ∀ (key query : List Bool), query.length = key.length → (family key query).length = key.length) (j n : ℕ) (adversary : MultiKeyDistinguisher t) (T : BitString n → BitString n) :

The word hybrid reduction is the finite one. For a length-preserving family and every table T on n-bit strings, presented on the word channel as randomFunctionOracle n T, the j-th word reduction on adversary n [] has the law of the finite hybrid reduction PRF.multiKeyReduction of PRF.atLevel family n on the adapted adversary, run against T. Both PRF games run the word reduction against such a table: prfIdealGame against a uniform one, and prfRealGame against PRF.atLevel family n key for a uniform key, whose word oracle is prfOracle family n key.

theorem Cslib.Crypto.advantage_prfMultiRealGame_prfMultiIdealGame_le {family : List Bool → List Bool → List Bool} {t : ℕ} (hlength : ∀ (key query : List Bool), query.length = key.length → (family key query).length = key.length) (adversary : MultiKeyDistinguisher t) (n : ℕ) :
Game.advantage (prfMultiRealGame family t adversary n).eval (prfMultiIdealGame t adversary n).eval ≤ ∑ j ∈ Finset.range t, Game.advantage (prfRealGame id family (prfMultiReduction family t j adversary) n).eval (prfIdealGame id id (prfMultiReduction family t j adversary) n).eval

Hybrid bound, a step toward [BS23], Exercise 4.26, not the cited result: for a length-preserving family, the advantage of a multi-key adversary is at most the sum of the PRF advantages of the t hybrid reductions. The exercise asks for one elementary wrapper B with PRFadv[A, F'] = n · PRFadv[B, F].

Constant-key-count step toward [BS23], Exercise 4.26, not the cited result: for every constant number t of keys, no oracle-PPT adversary distinguishes t keyed copies of a pseudorandom function from t independent uniform random functions. The exercise allows any polynomially bounded number n ≥ 1 of keys; that statement is open (#5293). The Luby–Rackoff theorems use this one with t = 3 and t = 4.