Documentation

CatCryptCore.Crypto.MultiQueryPRF

Multi-Query PRF Security via Hybrid Argument #

This file provides the standard q-fold hybrid argument for bounding the advantage of a q-query PRF adversary:

`Adv_q(F) ≤ q · Adv_1(F)`

Overview #

Given a PRF F : K → D → R, the q-query PRF game answers q queries. The hybrid argument interpolates between real and ideal:

Each adjacent pair of hybrids differs by exactly one query, and the advantage of distinguishing them is bounded by the single-query PRF advantage. The total advantage is then at most q · ε₁.

Key Theorems #

References #

Abstract PRF Specification #

Abstract PRF specification parameterized by key, domain, and range types.

  • eval : KDR

    The PRF evaluation function

Instances For

    Single-Query PRF Games #

    noncomputable def CatCrypt.Crypto.MultiQueryPRF.prf_query_real {K D R : Type} [Fintype K] [Nonempty K] [Fintype R] [Nonempty R] (F : PRFSpec K D R) (x : D) :

    Single-query real PRF game: sample key, return F(k, x)

    Equations
    Instances For
      noncomputable def CatCrypt.Crypto.MultiQueryPRF.prf_query_ideal {D R : Type} [Fintype R] [Nonempty R] (_x : D) :

      Single-query ideal PRF game: return random R

      Equations
      Instances For

        Multi-Query Hybrid Games #

        The q-query hybrid game is parameterized by a natural number i.
        We use an **abstract** hybrid sequence indexed by ℕ, where:
        - G 0 = all-real game
        - G q = all-ideal game
        - G i differs from G (i+1) in exactly one query position
        
        The concrete construction of these hybrids depends on the query model.
        Here we provide the general-purpose bound that works for any such sequence.
        
        theorem CatCrypt.Crypto.MultiQueryPRF.prf_multi_query_bound {α : Type} (G : Core.SPComp α) (A : αCore.SPComp Bool) (q : ) (ε : ENNReal) (hstep : i < q, AdvantageA (G i) (G (i + 1)) A ε) :
        AdvantageA (G 0) (G q) A q * ε

        Multi-query PRF security bound: the q-query advantage is at most q · ε.

        Given a sequence of q hybrid games G where each adjacent pair differs by at most ε, the total advantage is at most q · ε.

        In the PRF setting:

        • G 0 = real game (all queries answered by PRF)
        • G q = ideal game (all queries answered randomly)
        • Each G i → G (i+1) changes one query from real to random
        theorem CatCrypt.Crypto.MultiQueryPRF.prf_multi_query_dep_bound {α : Type} (real ideal : Core.SPComp α) (G : Core.SPComp α) (A : αCore.SPComp Bool) (q : ) (ε : ENNReal) (hleft : real = G 0) (hright : ideal = G q) (hstep : i < q, AdvantageA (G i) (G (i + 1)) A ε i) :
        AdvantageA real ideal A iFinset.range q, ε i

        Multi-query PRF with dependent step bounds: different queries may have different single-query advantages.

        theorem CatCrypt.Crypto.MultiQueryPRF.prf_multi_query_perfect {α : Type} (G : Core.SPComp α) (q : ) (hperf : i < q, Relational.rHoare Relational.eqPre (G i) (G (i + 1)) Relational.eqPost) (A : αCore.SPComp Bool) :
        AdvantageA (G 0) (G q) A = 0

        Perfect multi-query PRF: when all steps are perfectly indistinguishable, the multi-query advantage is 0.

        theorem CatCrypt.Crypto.MultiQueryPRF.prf_multi_query_nested {α : Type} (G : Core.SPComp α) (A : αCore.SPComp Bool) (m q : ) (ε : ENNReal) (hstep : i < m, AdvantageA (G i) (G (i + 1)) A q * ε) :
        AdvantageA (G 0) (G m) A m * q * ε

        Nested multi-query bound: for a two-level hybrid argument (e.g., multi-instance × multi-query), the total advantage is m · q · ε.