Documentation

CslibFrontier.Crypto.Primitives.UHF.CBCMAC

Computational universal hashing from CBC-MAC #

This proves the CBC-MAC case of [BS23], v0.6, Corollary 7.5 (printed p. 260). The collision game includes the empty word. The prefix-free wrapper appends one block before querying the CBC oracle, so its queries are in the nonempty CBC domain. Composing the batch wrapper with the CBC-to-PRF reduction gives an explicit distinguisher and a birthday bound. The single-pair bound applies it to a two-message batch. The cascade case is in CslibFrontier/Crypto/Primitives/UHF/Cascade.lean.

Main definitions #

Main results #

Compose the prefix-free batch collision wrapper with the base-PRF reduction for CBC-MAC on the domain with one extra block.

theorem Cslib.Crypto.UHF.succProbability_multiQueryGame_cbcMac_le {family : List Bool → List Bool → List Bool} (hlen : ∀ (key query : List Bool), query.length = key.length → (family key query).length = key.length) (ℓ Q : ℕ → ℕ) (guessBatch : ℕ × ℕ → ProbComp (List (List Bool))) {n : ℕ} (hBudget : ∀ guesses ∈ (guessBatch (n, n)).eval.support, guesses.length ≤ Q n) :
(multiQueryGame pure (fun (x d : ℕ) => lpBlockValid ℓ d) (fun (x d : ℕ) (key : BitString d) => cbcMacFamily family (List.ofFn key)) guessBatch n).succProbability ≤ Game.advantage (prfRealGame id family (cbcMacMultiQueryReduction ℓ Q guessBatch) n).eval (prfIdealGame id id (cbcMacMultiQueryReduction ℓ Q guessBatch) n).eval + ↑(Q n) ^ 2 * (↑(ℓ n) + 1) ^ 2 / (2 * 2 ^ n) + ↑((Q n).choose 2) / 2 ^ n

The concrete CBC-MAC bound from [BS23], v0.6, Corollary 7.5 (printed p. 260). The CBC term is Q² * (ℓ + 1)² / (2 * 2^n) as in (7.10). For the reply collisions, the bound uses the exact pair count Q.choose 2 from (7.9). At parameter zero the only valid word is empty. If the block alphabet is too small for fresh-block search at positive width, the CBC term already bounds the probability by one.

theorem Cslib.Crypto.UHF.succProbability_collisionGame_cbcMac_le {family : List Bool → List Bool → List Bool} (hlen : ∀ (key query : List Bool), query.length = key.length → (family key query).length = key.length) (ℓ : ℕ → ℕ) (guess : ℕ × ℕ → ProbComp (CollisionGuess (List Bool))) (n : ℕ) :
have reduction := cbcMacMultiQueryReduction ℓ (fun (x : ℕ) => 2) fun (p : ℕ × ℕ) => collisionPairToBatch (guess p); (collisionGame pure (fun (x d : ℕ) => lpBlockValid ℓ d) (fun (x d : ℕ) (key : BitString d) => cbcMacFamily family (List.ofFn key)) guess n).succProbability ≤ Game.advantage (prfRealGame id family reduction n).eval (prfIdealGame id id reduction n).eval + 2 ^ 2 * (↑(ℓ n) + 1) ^ 2 / (2 * 2 ^ n) + 1 / 2 ^ n

The single-pair CBC-MAC bound from [BS23], v0.6, Corollary 7.5 (printed p. 260). The collision guess is presented to the multi-query reduction as a batch with Q = 2.

The CBC-MAC case of [BS23], v0.6, Corollary 7.5 (printed p. 260), for batches. CBC-MAC on zero to ℓ n whole blocks is a multi-query UHF under a length-preserving secure PRF. The word model uses uniform n-bit keys and a unary polynomial-time block cap.

The CBC-MAC case of [BS23], v0.6, Corollary 7.5 (printed p. 260), for single-pair adversaries. A secure length-preserving PRF gives a computational UHF on zero to ℓ n whole blocks, with uniform n-bit keys and a unary polynomial-time block cap.