Documentation

CslibFrontier.Crypto.Protocols.AnonymousToken.CRTDecoupling

Non-black-box G8 → G8.5 CRT witness-reuse decoupling for VOLE-ACT #

This module formalizes the non-black-box CRT witness-reuse decoupling hop (G8 → G8.5, where G8 follows [BaumEtAl2026FAEST] §10.10 Theorem 10.42 and G8.5 is this library's intermediate hop) as a standalone concrete finite query-bounded step (#7068). Given qTok non-adaptive ck-fixed token bundles (r j as witness prefix in r-first layout, raw-H5 output cmult), g8Game is coupled to g85Game via OracleComp.IdenticalUntilBad (crtDecouple_identicalUntilBad), and crtDecouple_advantage_le bounds their distinguishing advantage by qTok * (Adv^hide + Pr[binding]) + g85IvCollisionProb through badH5HidingReduction and badH5BindingReduction. Asymptotic PPT certificates, lazy H5 simulation, and end-to-end composition from G1–G8 remain open under #7068. The correctionOnlyBatchGame test in AnonymousTokenCRTDecoupling.lean shows that the G9 correction-only replacement can change advantage when the commitment opening is known.

Main definitions #

Main results #

References #

Transcript token bundle exposed to an H5-querying distinguisher in the CRT witness-reuse model (G8 coupled vs G8.5 decoupled).

  • com : C

    Note commitment c = Com.eval ck m r.

  • iv : IV

    Per-proof initialization vector iv.

  • d : Fin lam → ZMod 2

    Verifier mask delta d.

  • cmult : Fin nMult → Fin nMask → ZMod 2

    Garbled gate multiplier table cmult.

structure Cslib.Crypto.AnonymousToken.CRTDecoupling.G85Setup (CommitKey C Nullifier Context IV : Type) (nMult lam nMask qTok : ℕ) :

Configuration for non-black-box CRT witness-reuse decoupling (G8 → G8.5, where G8 follows [BBB+26c] §10.10 Theorem 10.42 and G8.5 is this library's intermediate hop): qTok token events (0 < qTok) with non-adaptive ck-fixed messages, openings r j in r-first layout (Fin lam → ZMod 2), IV generator ivGen, gate labels baseLabel, and adv making adaptive H5 queries over all qTok token bundles delivered together.

Sample a tuple over Fin n from independent component distributions.

def Cslib.Crypto.AnonymousToken.CRTDecoupling.badH5Key {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) (ck : CommitKey) (iv : Fin qTok → IV) (d r : Fin qTok → Fin lam → ZMod 2) (j : Fin qTok) (e : Fin nMult) :
CRTHazard.H5Query IV nMult lam

Complementary H5 query key (iv j, e, baseLabel ck j e + d j + r j) for token j and gate e.

def Cslib.Crypto.AnonymousToken.CRTDecoupling.isBadH5Query {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) (ck : CommitKey) (iv : Fin qTok → IV) (d r : Fin qTok → Fin lam → ZMod 2) (q : CRTHazard.H5Query IV nMult lam) :

Boolean check testing whether an H5 query hits badH5Key for some token j and gate e.

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.g8Game {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] [Fintype IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) :

Coupled G8 game ([BBB+26c] §10.10, Theorem 10.42) under the witness-reuse CRT mask option reusing commitment opening r j (r-first layout, rather than a flag named in [BBB+26c] or [ZPS26]): draws u j, sets d j := r j + u j, and sets cmult j e directly to the raw H5 value at badH5Key.

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.g8Handler {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) (ck : CommitKey) (iv : Fin qTok → IV) (d r : Fin qTok → Fin lam → ZMod 2) (cmult : Fin qTok → Fin nMult → Fin nMask → ZMod 2) (h5 : CRTHazard.H5Query IV nMult lam → Fin nMask → ZMod 2) (q : CRTHazard.H5Query IV nMult lam) (bad : Bool) :
PMF ((Fin nMask → ZMod 2) × Bool)

Coupled G8 StateT Bool oracle returning cmult on badH5Key and h5 otherwise.

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.g85Handler {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) (ck : CommitKey) (iv : Fin qTok → IV) (d r : Fin qTok → Fin lam → ZMod 2) (h5 : CRTHazard.H5Query IV nMult lam → Fin nMask → ZMod 2) (q : CRTHazard.H5Query IV nMult lam) (bad : Bool) :
PMF ((Fin nMask → ZMod 2) × Bool)

Decoupled G8.5 (this library's intermediate hop between FAEST's G8 and G9) StateT Bool oracle returning h5 q uniformly while latching bad := true if isBadH5Query triggers.

def Cslib.Crypto.AnonymousToken.CRTDecoupling.g85HandlerP {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) (ck : CommitKey) (iv : Fin qTok → IV) (d r : Fin qTok → Fin lam → ZMod 2) (h5 : CRTHazard.H5Query IV nMult lam → Fin nMask → ZMod 2) (q : CRTHazard.H5Query IV nMult lam) :
StateT Bool ProbComp (Fin nMask → ZMod 2)

ProbComp-valued variant of g85Handler for ProbOracleComp.runState.

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.g85FullRun {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] [Fintype IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) :

Full decoupled G8.5 (library intermediate hop) joint execution over (output, badH5, ivCollision).

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.g85Game {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] [Fintype IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) :

Decoupled G8.5 (library intermediate hop) distinguishing game: d j and cmult j are uniform and independent of r j and h5.

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.g85IvCollisionProb {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] [Fintype IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) :

Probability Pr[¬ Function.Injective iv] of an IV collision across the qTok proofs in g85FullRun (0 for counter IVs; replaces a fixed 2 ^ (-λ) constant bound).

theorem Cslib.Crypto.AnonymousToken.CRTDecoupling.crtDecouple_identicalUntilBad {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) (ck : CommitKey) (iv : Fin qTok → IV) (d r : Fin qTok → Fin lam → ZMod 2) (cmult : Fin qTok → Fin nMult → Fin nMask → ZMod 2) (h5 : CRTHazard.H5Query IV nMult lam → Fin nMask → ZMod 2) :
OracleComp.IdenticalUntilBad (OracleComp.sumHandler (fun (n : ℕ) => StateT.lift (ProbComp.unifOracle n)) (g8Handler setup ck iv d r cmult h5)) (OracleComp.sumHandler (fun (n : ℕ) => StateT.lift (ProbComp.unifOracle n)) (g85Handler setup ck iv d r h5)) fun (bad : Bool) => bad = true

IdenticalUntilBad connecting g8Handler and g85Handler lifted to ProbOracleComp: both agree identically while bad = false and preserve bad = true once triggered.

State passed across the two stages of badH5HidingReduction.

  • ck : CommitKey

    Commitment key ck.

  • jStar : Fin qTok

    Uniformly sampled target token index j* : Fin qTok.

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.badH5HidingReduction {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] [DecidableEq C] [Fintype IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) [NeZero qTok] :
TwoStage CommitKey (MessagePair (Unlinkability.CommitMsg Nullifier Context)) C Bool (BadH5HidingState CommitKey qTok)

Explicit TwoStage hiding reduction for BadH5 (concrete query-bounded step, #7068, sampling the full H5 table rather than lazy oracle simulation): chooses a uniform target token j*, submits (msgs ck j*, (msgs ck j*).bumpBal) (bumpBal ≠ msgs ck j*) to Com.toScheme, plugs challenge c* into token j*, and tests whether any logged H5 query recovers an opening r* satisfying Com.eval ck (msgs ck j*) r* = c*.

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.badH5BindingReduction {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] [DecidableEq C] [Fintype IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) [NeZero qTok] (ck : CommitKey) :

Explicit commitment-binding reduction (concrete step, #7068, sampling the full H5 table) extracting a BindingCollision between msgs ck j* and (msgs ck j*).bumpBal whenever badH5HidingReduction hits under b_hide = true.

theorem Cslib.Crypto.AnonymousToken.CRTDecoupling.crtDecouple_advantage_le {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] [DecidableEq C] [Fintype IV] [DecidableEq Nullifier] [DecidableEq Context] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) [NeZero qTok] :

Non-black-box CRT witness-reuse decoupling step (G8 → G8.5), original to this library as a concrete finite query-bounded bound (#7068, where G8 follows [BaumEtAl2026FAEST] §10.10 Theorem 10.42 and G8.5 is this library's intermediate hop): assuming 0 < qTok (NeZero qTok), any H5-adaptive distinguisher over the qTok non-adaptive ck-fixed token bundles (r j as witness prefix in r-first layout, raw-H5 cmult) has advantage between coupled g8Game and decoupled g85Game at most qTok * (Adv^hide + Pr[binding]) + g85IvCollisionProb via badH5HidingReduction and badH5BindingReduction (g85IvCollisionProb tracks IV injectivity instead of a fixed 2 ^ (-λ) term; asymptotic certificates and composition with G1–G8 remain open under #7068).

Opening-free batch simulation #

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.sampleDecoupledCRTBatch {C IV : Type} {nMult lam nMask qTok : ℕ} (com : Fin qTok → C) (ivGen : Fin qTok → ProbComp IV) :
ProbComp (Fin qTok → CRTProofToken C IV nMult lam nMask)

Sample the masked correction and CRT gate table independently of openings, given the public commitments and IV samplers.

noncomputable def Cslib.Crypto.AnonymousToken.CRTDecoupling.g85SimulatorGame {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] [Fintype IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) :

Run the batch CRT simulator. Openings are used to generate the commitments, not supplied to sampleDecoupledCRTBatch or the unprogrammed H5 handler.

theorem Cslib.Crypto.AnonymousToken.CRTDecoupling.g85Game_eq_simulator {CommitKey C Nullifier Context IV : Type} {nMult lam nMask qTok : ℕ} [DecidableEq IV] [Fintype IV] (setup : G85Setup CommitKey C Nullifier Context IV nMult lam nMask qTok) :

Erasing the ghost events in g85FullRun gives exactly the opening-free CRT simulator on public commitments, including adaptive H5 queries made after the batch is delivered.