Documentation

CslibFrontier.Crypto.Computational.PseudorandomFunction.PrefixHybrid.Split

Splitting the next prefix-hybrid table #

At a cut one block deeper, a word ending at or before the old cut has its own label. A longer word takes its label from the child table for its parent at the old cut, then evaluates the remaining suffix. The label table for short words and the child tables are independent. This is the ideal-table step in the cascade argument of [BS23], v0.6, Section 6.4.2 (printed pp. 229–230), using the hybrids of Section 4.6.1 (printed pp. 152–153).

Valid queries after the old cut must contain a complete next block. The equality is a law of the ideal table, including for adaptive queries with repeats.

def Cslib.Crypto.prefixHybridSplitAnswer {n cut width : ℕ} (family : List Bool → List Bool → List Bool) (short : { word : List Bool // word.length ≤ cut } → BitString n) (children : BitString cut → BitString width → BitString n) (query : List Bool) :

Read a short word's own label, or find the next-block label in its parent's child table and evaluate the remaining suffix. The caller handles query validity.

theorem Cslib.Crypto.prefixHybridSplitAnswer_of_length_le {n cut width : ℕ} {family : List Bool → List Bool → List Bool} {short : { word : List Bool // word.length ≤ cut } → BitString n} {children : BitString cut → BitString width → BitString n} {query : List Bool} (h : query.length ≤ cut) :
prefixHybridSplitAnswer family short children query = List.ofFn (short ⟨query, h⟩)

A query ending at or before the old cut reads its own label.

theorem Cslib.Crypto.prefixHybridSplitAnswer_of_lt_length {n cut width : ℕ} {family : List Bool → List Bool → List Bool} {short : { word : List Bool // word.length ≤ cut } → BitString n} {children : BitString cut → BitString width → BitString n} {query : List Bool} (h : cut < query.length) :
prefixHybridSplitAnswer family short children query = family (List.ofFn (children (BitString.ofList cut query) (BitString.ofList width (List.drop cut query)))) (List.drop (cut + width) query)

A query beyond the old cut reads its child label and evaluates the suffix after the block.

theorem Cslib.Crypto.eval_prefixHybridGame_add_eq_split (valid : ℕ → List Bool → Bool) (family : List Bool → List Bool → List Bool) (adversary : OracleDistinguisher) (n cut width : ℕ) [Fintype { word : List Bool // word.length ≤ cut }] (hwidth : 0 < width) (hnil : ∀ (seed : List Bool), family seed [] = seed) (hquery : ∀ (query : List Bool), valid n query = true → cut < query.length → cut + width ≤ query.length) :
(prefixHybridGame valid family adversary n (cut + width)).eval = (Probability.PMF.uniformOfFintype (({ word : List Bool // word.length ≤ cut } → BitString n) × (BitString cut → BitString width → BitString n))).bind fun (tables : ({ word : List Bool // word.length ≤ cut } → BitString n) × (BitString cut → BitString width → BitString n)) => OracleComp.interpret (OracleComp.sumHandler ProbComp.unifOracle fun (request : Unit × List Bool) => PMF.pure (if valid n request.2 = true then prefixHybridSplitAnswer family tables.1 tables.2 request.2 else [])) (adversary n [])

The next-cut hybrid has the same law as sampling an independent short-label table and a uniform child function for every parent. Valid queries beyond cut contain a whole next block, and evaluating an empty suffix returns its starting label.