Documentation

CslibFrontier.Crypto.Protocols.AnonymousToken.ROBridgePolyTime.Core

Shared Word-Level VOLEitH Channels, Verifier, Extractor, and ROM Handler #

Shared encoding, total-decoder, memoization, FAEST.Conversion verifier/extractor PPT certificates, distributional correspondences (VOLE.ROExtractor), bounded-growth romVOLEHandlerWord infrastructure, and the single-repetition VOLEITHSoundnessError bound (accept_le_of_soundnessError) used by the AnonymousToken.Basic and AnonymousToken.Conservation ROM bridges.

1. Word-level VOLEitH channels, encodings, and total decoders #

Three oracle channels exposed to an unextracted word-level VOLEitH ROM adversary: sign (proof-gated issuer / signing query), leaf (H_leaf), and fs (H_FS).

  • sign : ROMWordOp

    Proof-gated token issuance or credit conservation query.

  • leaf : ROMWordOp

    Leaf commitment random oracle H_leaf.

  • fs : ROMWordOp

    Fiat–Shamir challenge random oracle H_FS.

Instances For

    Explicit equivalence ROMWordOp ≃ Fin 3, witnessing Finite ROMWordOp and computable channel encoding.

    Per-channel query-cost indicator for ROMWordOp, charging 1 on channel op and 0 on the remaining channels.

    Word-level Fiat–Shamir oracle query (stmt, iv, coms, dCorr, preMsg).

    • stmt : List Bool

      Encoded public statement word.

    • iv : List Bool

      Proof initialization vector word.

    • coms : List (List Bool)

      List of leaf commitment digest words.

    • dCorr : List Bool

      Witness correction word d_corr.

    • preMsg : List Bool

      Pre-challenge check message word.

    theorem Cslib.Crypto.AnonymousToken.encWordFSQuery_iv_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → WordFSQuery} :
    theorem Cslib.Crypto.AnonymousToken.encWordFSQuery_dCorr_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → WordFSQuery} :
    theorem Cslib.Crypto.AnonymousToken.encWordFSQuery_preMsg_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → WordFSQuery} :
    theorem Cslib.Crypto.AnonymousToken.encWordFSQuery_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List Bool} {x2 : γ → List (List Bool)} {x3 x4 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encBits budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn Turing.MultiTapeTM.encBits budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { stmt := x0 x, iv := x1 x, coms := x2 x, dCorr := x3 x, preMsg := x4 x }) encIn encWordFSQuery budget
    theorem Cslib.Crypto.AnonymousToken.encWordFSQuery_coms_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → WordFSQuery} :
    theorem Cslib.Crypto.AnonymousToken.encWordFSQuery_mk_deg :
    Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × List Bool × List (List Bool) × List Bool × List Bool) => { stmt := p.1, iv := p.2.1, coms := p.2.2.1, dCorr := p.2.2.2.1, preMsg := p.2.2.2.2 }) encWordFSQueryFields encWordFSQuery 1 1
    theorem Cslib.Crypto.AnonymousToken.encWordFSQuery_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → List (List Bool)} {T2 S2 : γ → ℕ} {x3 : γ → List Bool} {T3 S3 : γ → ℕ} {x4 : γ → List Bool} {T4 S4 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encBits T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn Turing.MultiTapeTM.encBits T4 S4) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { stmt := x0 x, iv := x1 x, coms := x2 x, dCorr := x3 x, preMsg := x4 x }) encIn encWordFSQuery (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))
    theorem Cslib.Crypto.AnonymousToken.encWordFSQuery_stmt_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → WordFSQuery} :

    Word-level VOLEitH proof (iv, coms, dCorr, preMsg, openKeys).

    • iv : List Bool

      Proof initialization vector word.

    • coms : List (List Bool)

      Leaf commitment digests.

    • dCorr : List Bool

      Witness correction word d_corr.

    • preMsg : List Bool

      Pre-challenge check message word.

    • openKeys : List (List Bool)

      Opened seed keys k_idx (idx ≠ Δ).

    theorem Cslib.Crypto.AnonymousToken.encWordVOLEITHProof_iv_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → WordVOLEITHProof} :
    theorem Cslib.Crypto.AnonymousToken.encWordVOLEITHProof_preMsg_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → WordVOLEITHProof} :
    theorem Cslib.Crypto.AnonymousToken.encWordVOLEITHProof_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List (List Bool)} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} {x3 : γ → List Bool} {T3 S3 : γ → ℕ} {x4 : γ → List (List Bool)} {T4 S4 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encBits T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T4 S4) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { iv := x0 x, coms := x1 x, dCorr := x2 x, preMsg := x3 x, openKeys := x4 x }) encIn encWordVOLEITHProof (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))
    theorem Cslib.Crypto.AnonymousToken.encWordVOLEITHProof_mk_deg :
    Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × List (List Bool) × List Bool × List Bool × List (List Bool)) => { iv := p.1, coms := p.2.1, dCorr := p.2.2.1, preMsg := p.2.2.2.1, openKeys := p.2.2.2.2 }) encWordVOLEITHProofFields encWordVOLEITHProof 1 1
    theorem Cslib.Crypto.AnonymousToken.encWordVOLEITHProof_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List Bool} {x1 : γ → List (List Bool)} {x2 x3 : γ → List Bool} {x4 : γ → List (List Bool)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encBits budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { iv := x0 x, coms := x1 x, dCorr := x2 x, preMsg := x3 x, openKeys := x4 x }) encIn encWordVOLEITHProof budget
    theorem Cslib.Crypto.AnonymousToken.encWordVOLEITHProof_dCorr_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → WordVOLEITHProof} :
    @[reducible, inline]

    Leaf trace type at degree d with bit-string seeds, IVs, and raw (seedOut, com) outputs.

    @[reducible, inline]

    Fiat–Shamir trace type storing (WordFSQuery, chalBits) entries.

    @[reducible, inline]

    Combined two-channel word-level lazy ROM trace (tr_leaf, tr_FS).

    Equivalence decomposing LeafQuery d (List Bool) (List Bool) into framed tuple slots.

    @[reducible, inline]

    Framed encoding of LeafQuery d (List Bool) (List Bool).

    @[reducible, inline]

    Framed encoding of WordLeafTrace d.

    @[reducible, inline]

    Framed encoding of one entry in WordFSTrace.

    @[reducible, inline]
    noncomputable abbrev Cslib.Crypto.AnonymousToken.encWordRows (d : ℕ) :
    (Fin (2 ^ d) → List Bool) ↪ List Bool

    Encoding of Fin (2 ^ d) → List Bool expanded VOLE rows.

    @[reducible, inline]
    noncomputable abbrev Cslib.Crypto.AnonymousToken.encWordCols (d : ℕ) :

    Encoding of Fin d → List Bool verifier VOLE columns.

    @[reducible, inline]

    Framed encoding of a VOLE check-relation tail (uVec, preMsg, chal).

    Total decoder for encFinEnum (Fin (2 ^ d)), clamping unary lengths ≥ 2 ^ d to 2 ^ d - 1.

    Word-level LeafQuery.index projection is computable in plain polynomial time.

    Constructing a word-level LeafQuery is computable in plain polynomial time.

    2. Word-level memoization, FAEST.Conversion, verifier, and trace extractor #

    Normalize a bit list to fixed width len by zero-padding short lists and truncating long lists; agrees identically with encBitString len (BitString.ofList len w).

    Canonicalize a WordFSQuery to (d, comLen, rowLen) and normStmt so word-level lookup matches typed FSQuery d comLen rowLen lookup iff the decoded typed queries agree.

    def Cslib.Crypto.AnonymousToken.wordFSQueryToTyped {Stmt : Type} (d comLen rowLen : ℕ) (decStmt : List Bool → Stmt) (q : WordFSQuery) :
    Protocols.VOLE.FSQuery d comLen rowLen Stmt (List Bool) (List Bool)

    Convert a WordFSQuery to a typed VOLE.FSQuery d comLen rowLen.

    theorem Cslib.Crypto.AnonymousToken.wordFSQueryToTyped_canonicalize {Stmt : Type} (d comLen rowLen : ℕ) {encStmt : Stmt ↪ List Bool} (D : Turing.MultiTapeTM.Decoder encStmt) (q : WordFSQuery) :
    wordFSQueryToTyped d comLen rowLen D.decode (canonicalizeFSQuery d comLen rowLen (fun (w : List Bool) => encStmt (D.decode w)) q) = wordFSQueryToTyped d comLen rowLen D.decode q
    theorem Cslib.Crypto.AnonymousToken.canonicalizeFSQuery_eq_iff {Stmt : Type} (d comLen rowLen : ℕ) {encStmt : Stmt ↪ List Bool} (D : Turing.MultiTapeTM.Decoder encStmt) (q₁ q₂ : WordFSQuery) :
    canonicalizeFSQuery d comLen rowLen (fun (w : List Bool) => encStmt (D.decode w)) q₁ = canonicalizeFSQuery d comLen rowLen (fun (w : List Bool) => encStmt (D.decode w)) q₂ ↔ wordFSQueryToTyped d comLen rowLen D.decode q₁ = wordFSQueryToTyped d comLen rowLen D.decode q₂

    Canonical word-level H_leaf memoizer using BitString.sampleList.

    noncomputable def Cslib.Crypto.AnonymousToken.memoizeFSWord (d : ℕ) (comLen rowLen chalLen : ℕ → ℕ) (normStmt : List Bool → List Bool) (n : ℕ) (q : WordFSQuery) :

    Canonical word-level H_FS memoizer normalizing queries via canonicalizeFSQuery and sampling BitString.sampleList (chalLen n).

    Word-level FAEST.convertExpandedRows, returning (u, qCols) with width-normalized words.

    theorem Cslib.Crypto.AnonymousToken.convertExpandedRowsWord_eq (d width : ℕ) (rows : Fin (2 ^ d) → List Bool) :
    (convertExpandedRowsWord d width rows).1 = (Turing.MultiTapeTM.encBitString width) (FAEST.convertExpandedRows d fun (i : Fin (2 ^ d)) => BitString.ofList width (rows i)).u ∧ ∀ (j : Fin d), (convertExpandedRowsWord d width rows).2 j = (Turing.MultiTapeTM.encBitString width) ((FAEST.convertExpandedRows d fun (i : Fin (2 ^ d)) => BitString.ofList width (rows i)).columns j)
    noncomputable def Cslib.Crypto.AnonymousToken.collectOpenRowsWord (d : ℕ) (sdLen comLen rowLen : ℕ → ℕ) (expand : ℕ → List Bool → List Bool) (n : ℕ) (iv : List Bool) (openKeys coms : List (List Bool)) (hidden : Fin (2 ^ d)) (k : ℕ) :
    k ≤ 2 ^ d → StateT (WordLeafTrace d) ProbComp (Option (Fin (2 ^ d) → List Bool))

    Word-level VOLE.collectOpenRows, recursively opening 2 ^ d - 1 leaves via memoizeLeafWord and normalizing expanded rows to width rowLen n.

    noncomputable def Cslib.Crypto.AnonymousToken.voleithVerifyWord (d : ℕ) (sdLen comLen rowLen chalLen : ℕ → ℕ) (expand : ℕ → List Bool → List Bool) (chalToIdx : ℕ → List Bool → Fin (2 ^ d)) (normStmt : List Bool → List Bool) (checkRel : ℕ → List Bool → List Bool → (Fin d → List Bool) → List Bool → List Bool → List Bool → Bool) (n : ℕ) (ck stmt : List Bool) (prf : WordVOLEITHProof) :

    Word-level VOLEitH verifier over WordVOLETraceState d, running memoizeFSWord, collectOpenRowsWord, convertExpandedRowsWord, and checkRel.

    def Cslib.Crypto.AnonymousToken.extractWitnessBitsFromTrace {Wit : Type} (d : ℕ) (sdLen comLen rowLen : ℕ → ℕ) (expand : ℕ → List Bool → List Bool) (decWit : ℕ → List Bool → Wit) (n : ℕ) (tr : WordLeafTrace d) (prf : WordVOLEITHProof) :
    Wit

    Word-level straight-line witness extractor matching VOLE.extractWitnessFromTrace.

    def Cslib.Crypto.AnonymousToken.WordTraceLenInv (d : ℕ) (sdLen comLen rowLen chalLen : ℕ → ℕ) (normStmt : List Bool → List Bool) (n : ℕ) (roSt : WordVOLETraceState d) :

    Length invariant on WordVOLETraceState d: every cached leaf output has widths (sdLen n, comLen n) and every cached FS entry is canonicalized with challenge width chalLen n.

    2b. Distributional Correspondence to VOLE.ROExtractor #

    Typed representation of a word-level leaf RO trace.

    def Cslib.Crypto.AnonymousToken.repWordFSTrace {Stmt : Type} (d comLen rowLen chalLen : ℕ) (decStmt : List Bool → Stmt) (tr : WordFSTrace) :
    Protocols.VOLE.FSTrace d comLen rowLen Stmt (List Bool) (List Bool) (BitString chalLen)

    Typed representation of a word-level Fiat–Shamir RO trace.

    def Cslib.Crypto.AnonymousToken.repWordVOLETraceState {Stmt : Type} (d : ℕ) (sdLen comLen rowLen chalLen : ℕ → ℕ) (decStmt : List Bool → Stmt) (n : ℕ) :
    WordVOLETraceState d → Protocols.VOLE.VOLEITHTraceState d (sdLen n) (comLen n) (rowLen n) Stmt (List Bool) (List Bool) (List Bool) (BitString (chalLen n))

    Typed representation of the combined word-level VOLE-in-the-head RO trace state.

    Convert a WordVOLEITHProof into a typed Protocols.VOLE.VOLEITHProof.

    def Cslib.Crypto.AnonymousToken.wordExpandBit (sdLen rowLen : ℕ → ℕ) (expand : ℕ → List Bool → List Bool) (n : ℕ) (sd : BitString (sdLen n)) :
    BitString (rowLen n)

    Typed BitString view of a word-level PRG seed-expansion function expand n.

    def Cslib.Crypto.AnonymousToken.wordDecWitBit {Wit : Type} (rowLen : ℕ → ℕ) (decWit : ℕ → List Bool → Wit) (n : ℕ) (u : BitString (rowLen n)) :
    Wit

    Typed BitString view of a word-level witness decoder decWit n.

    def Cslib.Crypto.AnonymousToken.wordChalToIdxBit (d : ℕ) (chalLen : ℕ → ℕ) (chalToIdx : ℕ → List Bool → Fin (2 ^ d)) (n : ℕ) (delta : BitString (chalLen n)) :
    Fin (2 ^ d)

    Typed BitString view of a word-level challenge-to-index map chalToIdx n.

    def Cslib.Crypto.AnonymousToken.wordVOLECheckRelBit {Stmt : Type} (d : ℕ) (rowLen chalLen : ℕ → ℕ) (encStmt : Stmt → List Bool) (checkRel : ℕ → List Bool → List Bool → (Fin d → List Bool) → List Bool → List Bool → List Bool → Bool) (n : ℕ) (ck : List Bool) (stmt : Stmt) (qCols : Fin d → BitString (rowLen n)) (dCorr : BitString (rowLen n)) (preMsg : List Bool) (delta : BitString (chalLen n)) :

    Typed BitString view of a word-level VOLE-in-the-head algebraic check relation.

    Shared word-level handler dispatching .sign to a caller-supplied signature branch and .leaf / .fs to memoizeLeafWord / memoizeFSWord on WordVOLETraceState d.

    theorem Cslib.Crypto.AnonymousToken.accept_le_of_soundnessError {d rowLen : ℕ} {Stmt PreMsg Chal Wit : Type} [Fintype Chal] [Nonempty Chal] (decWit : BitString rowLen → Wit) (chalToIdx : Chal → Fin (2 ^ d)) (Rel : Stmt → Wit → Bool) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (ε : NNReal) (hSound : Protocols.VOLE.VOLEITHSoundnessError decWit chalToIdx Rel checkRel ε) (stmt : Stmt) (rows : Fin (2 ^ d) → BitString rowLen) (dCorr : BitString rowLen) (preMsg : PreMsg) (y : BitString rowLen) (hy : Rel stmt (decWit y) = false) :
    (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {delta : Chal | checkRel stmt (FAEST.convertExpandedRows d (FAEST.verifierRows rows (chalToIdx delta))).columns dCorr preMsg delta = true} ≤ 2 ^ d * ↑ε

    Single-repetition soundness barrier for VOLEITHSoundnessError: under VOLEITHSoundnessError ... ε, any statement stmt admitting a non-witness y in the image of decWit is accepted with probability at most 2 ^ d * ε over the uniform challenge Chal for every prover table (rows, dCorr, preMsg) (honest provers included); multi-repetition soundness remains open under #7068.

    theorem Cslib.Crypto.AnonymousToken.voleithKSBound_eq_slack_add (d comLen Q_leaf Q_FS m : ℕ) (ε : NNReal) :
    Protocols.VOLE.voleithKSBound d comLen (Q_leaf + m * (2 ^ d - 1)) (Q_FS + m) ε = ↑((Q_leaf + m * (2 ^ d - 1)) * (Q_leaf + m * (2 ^ d - 1) + 2 ^ d * (Q_FS + m))) / 2 ^ comLen + ↑(Q_FS + m) * ε

    Decompose voleithKSBound d comLen (Q_leaf + m * (2 ^ d - 1)) (Q_FS + m) ε into its commitment-collision/FS-binding polynomial-over-2^comLen slack and (Q_FS + m) * ε.

    theorem Cslib.Crypto.AnonymousToken.succProbability_le_add_of_ennreal {p : PMF Bool} {rhs : ENNReal} (hrhs : rhs ≠ ⊤) {a b : NNReal} (h : p true ≤ rhs + ↑(a + b)) :

    Convert an ENNReal event-probability bound p true ≤ rhs + ((a + b : ℝ≥0) : ENNReal) into a Game.succProbability bound Game.succProbability p ≤ (rhs.toNNReal + a) + b.