Documentation

CslibFrontier.Crypto.Protocols.VOLE.KOSExtractor

KOS consistency affine extractor and exact binomial loss #

Section 10.6 of the FAEST v3.0 specification ([BBB+26c], Lemma 10.26 and Corollary 10.27, pp. 97–99) analyzes the VOLEHash consistency check through an explicit affine-line extractor E_{KOS,S}(H, ũ, ṽ) over a finite collection S of candidate (Δ, q) openings:

Source correspondence and scope #

These theorems formalize the abstract IsUniversalHash steps of Lemma 10.26 and Corollary 10.27, not FAEST's concrete VOLEHash endpoints:

Main definitions #

Main results #

References #

An affine line Δ ↦ Δ • slope + intercept over a module V ([BBB+26c], §10.6, pp. 97–99, representing (u, v) with evaluation u · Δ + v).

  • slope : V

    Linear coefficient u (slope).

  • intercept : V

    Constant coefficient v (intercept).

Instances For
    theorem Cslib.Crypto.Protocols.VOLE.KOSLine.ext {V : Type u_1} {x y : KOSLine V} (slope : x.slope = y.slope) (intercept : x.intercept = y.intercept) :
    x = y
    @[instance_reducible]
    def Cslib.Crypto.Protocols.VOLE.KOSLine.eval {F : Type u_1} {V : Type u_2} [SMul F V] [Add V] (line : KOSLine V) (delta : F) :
    V

    Evaluate the affine line Δ ↦ Δ • line.slope + line.intercept.

    theorem Cslib.Crypto.Protocols.VOLE.KOSLine.eq_of_eval_eq {F : Type u_1} {V : Type u_2} [Field F] [AddCommGroup V] [Module F V] {line₁ line₂ : KOSLine V} {Δ₀ Δ₁ : F} (hne : Δ₀ ≠ Δ₁) (h₀ : line₁.eval Δ₀ = line₂.eval Δ₀) (h₁ : line₁.eval Δ₁ = line₂.eval Δ₁) :
    line₁ = line₂

    Two affine lines over a vector space that agree at two distinct points Δ₀ ≠ Δ₁ are equal.

    def Cslib.Crypto.Protocols.VOLE.IsResponseGraph {F : Type u_1} {V : Type u_2} (responses : List (F × V)) :

    responses is the graph of a partial response function (S_t in [BBB+26c], Corollary 10.27, p. 98) when equal challenges carry equal responses.

    theorem Cslib.Crypto.Protocols.VOLE.IsResponseGraph.of_nodup_fst {F : Type u_1} {V : Type u_2} {responses : List (F × V)} (h : (List.map Prod.fst responses).Nodup) :
    IsResponseGraph responses

    Any opening list with pairwise distinct challenges satisfies IsResponseGraph.

    def Cslib.Crypto.Protocols.VOLE.kosAffineDefect {F : Type u_1} {V : Type u_2} [Field F] [AddCommGroup V] [Module F V] (p₀ p₁ p₂ : F × V) :
    V

    Affine collinearity defect of three openings p₀, p₁, p₂ : F × V ([BBB+26c], Lemma 10.26 proof, p. 98): (p₁.1 - p₀.1) • (p₂.2 - p₀.2) - (p₂.1 - p₀.1) • (p₁.2 - p₀.2).

    theorem Cslib.Crypto.Protocols.VOLE.kosAffineDefect_eq_zero_of_eval_eq {F : Type u_1} {V : Type u_2} [Field F] [AddCommGroup V] [Module F V] {line : KOSLine V} {p₀ p₁ p₂ : F × V} (h₀ : line.eval p₀.1 = p₀.2) (h₁ : line.eval p₁.1 = p₁.2) (h₂ : line.eval p₂.1 = p₂.2) :
    kosAffineDefect p₀ p₁ p₂ = 0

    Three openings lying on a single KOSLine have zero kosAffineDefect.

    def Cslib.Crypto.Protocols.VOLE.HasKOSBadTriple {F : Type u_1} {V : Type u_2} {W : Type u_3} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] (h : V →ₗ[F] W) (responses : List (F × V)) :

    Bad-triple predicate (step corresponding to Bad event 2 in [BBB+26c], Lemma 10.26, p. 98): three openings in responses at pairwise distinct challenges have a nonzero kosAffineDefect mapped to 0 by h.

    theorem Cslib.Crypto.Protocols.VOLE.not_hasKOSBadTriple_of_length_le_two {F : Type u_1} {V : Type u_2} {W : Type u_3} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] (h : V →ₗ[F] W) {responses : List (F × V)} (hlen : responses.length ≤ 2) :
    ¬HasKOSBadTriple h responses

    Lists of at most two openings cannot contain three pairwise distinct challenges and therefore never satisfy HasKOSBadTriple.

    def Cslib.Crypto.Protocols.VOLE.kosExtract {F : Type u_1} {V : Type u_2} {W : Type u_3} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] [DecidableEq F] [DecidableEq W] (h : V → W) (responses : List (F × V)) (target : KOSLine W) :

    Executable, total KOS affine-line extractor ([BBB+26c], §10.6, Lemma 10.26 and Corollary 10.27, pp. 97–99). Selects accepted openings via selectAccepted and handles 0, 1, and ≥ 2 distinct accepted challenges via interpolateKOSLine.

    theorem Cslib.Crypto.Protocols.VOLE.kosExtract_eq_of_eqOn_snd {F : Type u_1} {V : Type u_2} {W : Type u_3} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] [DecidableEq F] [DecidableEq W] {h₁ h₂ : V → W} {responses : List (F × V)} (target : KOSLine W) (heq : ∀ p ∈ responses, h₁ p.2 = h₂ p.2) :
    kosExtract h₁ responses target = kosExtract h₂ responses target

    kosExtract reads h only at the response vectors p.2 for p ∈ responses.

    @[simp]
    theorem Cslib.Crypto.Protocols.VOLE.kosExtract_nil {F : Type u_1} {V : Type u_2} {W : Type u_3} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] [DecidableEq F] [DecidableEq W] (h : V → W) (target : KOSLine W) :
    kosExtract h [] target = { slope := 0, intercept := 0 }
    theorem Cslib.Crypto.Protocols.VOLE.kosExtract_singleton_of_eq {F : Type u_1} {V : Type u_2} {W : Type u_3} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] [DecidableEq F] [DecidableEq W] {h : V → W} {p₀ : F × V} {target : KOSLine W} (h₀ : h p₀.2 = target.eval p₀.1) :
    kosExtract h [p₀] target = { slope := 0, intercept := p₀.2 }

    On a single accepted opening p₀, kosExtract returns the constant line ⟨0, p₀.2⟩.

    structure Cslib.Crypto.Protocols.VOLE.KOSFailureWitness {F : Type u_1} {V : Type u_2} {W : Type u_3} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] (h : V →ₗ[F] W) (responses : List (F × V)) (target : KOSLine W) :
    Type (max u_1 u_2)

    Explicit computable failure witness from any failed extraction on a response graph ([BBB+26c], Lemma 10.26 proof, p. 98).

    def Cslib.Crypto.Protocols.VOLE.kosFailureWitness {F : Type u_1} {V : Type u_2} {W : Type u_3} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] [DecidableEq F] [DecidableEq W] (h : V →ₗ[F] W) {responses : List (F × V)} (hgraph : IsResponseGraph responses) {target : KOSLine W} {p : F × V} (hp : p ∈ responses) (hhash : h p.2 = target.eval p.1) (hfail : (kosExtract (⇑h) responses target).eval p.1 ≠ p.2) :
    KOSFailureWitness h responses target

    Construct an explicit KOSFailureWitness whenever kosExtract misses an accepted opening p of a response graph responses.

    theorem Cslib.Crypto.Protocols.VOLE.kosExtract_eval_eq_of_not_hasKOSBadTriple {F : Type u_1} {V : Type u_2} {W : Type u_3} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] [DecidableEq F] [DecidableEq W] (h : V →ₗ[F] W) {responses : List (F × V)} (hgraph : IsResponseGraph responses) (hnobad : ¬HasKOSBadTriple h responses) (target : KOSLine W) {p : F × V} (hp : p ∈ responses) (hhash : h p.2 = target.eval p.1) :
    (kosExtract (⇑h) responses target).eval p.1 = p.2

    Deterministic extraction step of [BBB+26c], §10.6, Lemma 10.26 and Corollary 10.27 (pp. 97–99): on a response graph responses, if HasKOSBadTriple h responses does not hold, then every opening p ∈ responses accepted by target lies on kosExtract h responses target.

    def Cslib.Crypto.Protocols.VOLE.HasKOSBadPair {F : Type u_2} {V : Type u_3} {W : Type u_4} (h : V → W) (responses : List (F × V)) :

    Bad-pair predicate (step corresponding to Bad event 1 in [BBB+26c], Lemma 10.26, p. 98): two openings in responses share the same challenge Δ with distinct response vectors q₀ ≠ q₁ whose hashes collide. Impossible when IsResponseGraph responses holds.

    theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_hasKOSBadPair_le {Seed : Type u_1} {F : Type u_2} {V : Type u_3} {W : Type u_4} {seed : PMF Seed} {h : Seed → V → W} {ε : ENNReal} (hh : Probability.IsUniversalHash seed h ε) (responses : List (F × V)) :
    seed.toOuterMeasure {s : Seed | HasKOSBadPair (h s) responses} ≤ ε * ↑(responses.length.choose 2)

    Bad-pair union-bound step of [BBB+26c], §10.6, Lemma 10.26 (Bad event 1, p. 98), derived from IsUniversalHash.toOuterMeasure_not_injOn_le: for any ε-universal hash family h, HasKOSBadPair (h s) responses holds with seed probability at most ε * (responses.length.choose 2).

    theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_hasKOSBadTriple_le {Seed : Type u_1} {F : Type u_2} {V : Type u_3} {W : Type u_4} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] {seed : PMF Seed} {H : Seed → V →ₗ[F] W} {ε : ENNReal} (hH : Probability.IsUniversalHash seed (fun (s : Seed) (v : V) => (H s) v) ε) (responses : List (F × V)) :
    seed.toOuterMeasure {s : Seed | HasKOSBadTriple (H s) responses} ≤ ε * ↑(responses.length.choose 3)

    Bad-triple union-bound step of [BBB+26c], §10.6, Lemma 10.26 (Bad event 2, p. 98): for any ε-universal linear hash family H, HasKOSBadTriple (H s) responses holds with seed probability at most ε * (responses.length.choose 3).

    theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_kosExtract_graph_failure_le {Seed : Type u_1} {F : Type u_2} {V : Type u_3} {W : Type u_4} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] [DecidableEq F] [DecidableEq W] {seed : PMF Seed} {H : Seed → V →ₗ[F] W} {ε : ENNReal} (hH : Probability.IsUniversalHash seed (fun (s : Seed) (v : V) => (H s) v) ε) {responses : List (F × V)} (hgraph : IsResponseGraph responses) :
    seed.toOuterMeasure {s : Seed | ∃ (target : KOSLine W), ∃ p ∈ responses, (H s) p.2 = target.eval p.1 ∧ (kosExtract (⇑(H s)) responses target).eval p.1 ≠ p.2} ≤ ε * ↑(responses.length.choose 3)

    Abstract response-graph step toward [BBB+26c], §10.6, Corollary 10.27 (pp. 98–99), not the concrete VOLEHash / Lemma 10.19 endpoint (which remains open under #4987): when responses is a response graph and H is an ε-universal linear hash family, the probability over s ← seed that there exists any hashed line target and accepted opening p ∈ responses missed by kosExtract (H s) responses target is at most ε * (responses.length.choose 3), matching choose |S_t| 3 · ε on a duplicate-free enumeration of S_t.

    theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_kosExtract_failure_le {Seed : Type u_1} {F : Type u_2} {V : Type u_3} {W : Type u_4} [Field F] [AddCommGroup V] [Module F V] [AddCommGroup W] [Module F W] [DecidableEq F] [DecidableEq W] {seed : PMF Seed} {H : Seed → V →ₗ[F] W} {ε : ENNReal} (hH : Probability.IsUniversalHash seed (fun (s : Seed) (v : V) => (H s) v) ε) (responses : List (F × V)) :
    seed.toOuterMeasure {s : Seed | ∃ (target : KOSLine W), ∃ p ∈ responses, (H s) p.2 = target.eval p.1 ∧ (kosExtract (⇑(H s)) responses target).eval p.1 ≠ p.2} ≤ ε * (↑(responses.length.choose 2) + ↑(responses.length.choose 3))

    Abstract universal-hash step of [BBB+26c], §10.6, Lemma 10.26 (pp. 97–98), not the concrete VOLEHash instantiation (tracked in #4987): on an arbitrary finite opening list responses (without assuming IsResponseGraph), extraction fails with probability at most ε * (responses.length.choose 2 + responses.length.choose 3). On a duplicate-free enumeration responses.Nodup of S, responses.length = |S|, matching the proof's binomial bound before Lemma 10.26's cubic relaxation (|S|³ / 6 + |S|² / 2) ε.