Documentation

CslibFrontier.Crypto.Protocols.AnonymousToken.PolyTime

Polynomial-time reduction witnesses for anonymous tokens and VOLE-ACT #

This module provides uniform strict-PPT / oracle-PPT word-level realizations and runtime certificates for the extracted-model reductions in CslibFrontier.Crypto.Protocols.AnonymousToken (tracked under #7068):

Each reduction is certified directly against IsPPTOn / IsOraclePPTOn / IsPPT / IsOraclePPT with truncated adaptive oracle replies (IsOraclePPTOn.query_take) and proved equal in PMF law to its typed extracted-model counterpart when instantiated on a WordSignatureScheme and a polynomial-time target / commitment function. Combining WordSignatureScheme.EUFCMA and CollisionResistant yields asymptotic word-level unforgeability and extracted credit conservation without introducing any new hardness assumptions or leaking ComputableTidily / IsTidy.

This module stays within the extracted-witness asymptotic word model; the single-issuer draft bridge (including issuer V4 range and policy enforcement) lives in IssuerBridgePolyTime, while VOLEitH witness extraction, zero-knowledge, and RandomTarget.reduceRedemptions remain separate (#7068).

Because word-level adversaries (WordExtractedForgerOf, WordExtractedAdversary) emit arbitrary bit strings w : List Bool as oracle queries, both reductions (targetForgerWordOf, noteForgerHandlerWord) and their corresponding word games (extractedTokenWordGame, extractedConservationWordGame, via .toTyped) process every query as the typed value returned by its total Decoder (payloadDecoderOf D, wordRequestDecoder), rather than rejecting malformed query words as parse errors under a PartialDecoder. Because these total decoders still parse pieces of the input (e.g., pair components or the leading tag bit selecting issue vs. spend before decoding the tail), the resulting typed value can depend on the malformed input.

Encodings and total decoders #

def Cslib.Crypto.AnonymousToken.encPayloadOf {Message : Type} (encM : Message ↪ List Bool) :

Encode a semantic payload (message, opening) with bit-string opening randomness.

theorem Cslib.Crypto.AnonymousToken.encPayloadOf_mk_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Message} {x1 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn encM) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { message := x0 x, opening := x1 x }) encIn (encPayloadOf encM)
theorem Cslib.Crypto.AnonymousToken.encPayloadOf_message_inO {Message : Type} (encM : Message ↪ List Bool) :
Turing.MultiTapeTM.ComputableInO Payload.message (encPayloadOf encM) encM (fun (a : Payload Message (List Bool)) => ((encPayloadOf encM) a).length) fun (a : Payload Message (List Bool)) => ((encPayloadOf encM) a).length
theorem Cslib.Crypto.AnonymousToken.encPayloadOf_message_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Payload Message (List Bool)} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encPayloadOf encM) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).message) encIn✝ encM
theorem Cslib.Crypto.AnonymousToken.encPayloadOf_mk_budget {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Message} {x1 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encM budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { message := x0 x, opening := x1 x }) encIn (encPayloadOf encM) budget
theorem Cslib.Crypto.AnonymousToken.encPayloadOf_message_budget {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Payload Message (List Bool)} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encPayloadOf encM) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).message) encIn✝ encM S✝
@[simp]
theorem Cslib.Crypto.AnonymousToken.encPayloadOf_apply {Message : Type} (encM : Message ↪ List Bool) (a : Payload Message (List Bool)) :
@[reducible, inline]
abbrev Cslib.Crypto.AnonymousToken.encPayloadOfFields {Message : Type} (encM : Message ↪ List Bool) :

The tuple of the fields of encPayloadOf.

theorem Cslib.Crypto.AnonymousToken.encPayloadOf_opening_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Payload Message (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.encPayloadOf_opening_budget {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Payload Message (List Bool)} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encPayloadOf encM) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).opening) encIn✝ Turing.MultiTapeTM.encBits S✝
theorem Cslib.Crypto.AnonymousToken.encPayloadOf_mk_inO {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Message} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encM T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { message := x0 x, opening := x1 x }) encIn (encPayloadOf encM) (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
theorem Cslib.Crypto.AnonymousToken.encPayloadOf_mk_deg {Message : Type} (encM : Message ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : Message × List Bool) => { message := p.1, opening := p.2 }) (encPayloadOfFields encM) (encPayloadOf encM) 1 1
theorem Cslib.Crypto.AnonymousToken.encPayloadOf_message_length_le {Message : Type} (encM : Message ↪ List Bool) (a : Payload Message (List Bool)) :
(encM a.message).length ≤ ((encPayloadOf encM) a).length
def Cslib.Crypto.AnonymousToken.encTokenOf {Message : Type} (encM : Message ↪ List Bool) :

Encode a certified token (payload, signature) with bit-string signature.

theorem Cslib.Crypto.AnonymousToken.encTokenOf_mk_budget {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Payload Message (List Bool)} {x1 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn (encPayloadOf encM) budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { payload := x0 x, signature := x1 x }) encIn (encTokenOf encM) budget
theorem Cslib.Crypto.AnonymousToken.encTokenOf_signature_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Token Message (List Bool) (List Bool)} :
@[simp]
theorem Cslib.Crypto.AnonymousToken.encTokenOf_apply {Message : Type} (encM : Message ↪ List Bool) (a : Token Message (List Bool) (List Bool)) :
theorem Cslib.Crypto.AnonymousToken.encTokenOf_mk_inO {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Payload Message (List Bool)} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (encPayloadOf encM) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { payload := x0 x, signature := x1 x }) encIn (encTokenOf encM) (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
theorem Cslib.Crypto.AnonymousToken.encTokenOf_payload_inO {Message : Type} (encM : Message ↪ List Bool) :
Turing.MultiTapeTM.ComputableInO Token.payload (encTokenOf encM) (encPayloadOf encM) (fun (a : Token Message (List Bool) (List Bool)) => ((encTokenOf encM) a).length) fun (a : Token Message (List Bool) (List Bool)) => ((encTokenOf encM) a).length
theorem Cslib.Crypto.AnonymousToken.encTokenOf_mk_deg {Message : Type} (encM : Message ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : Payload Message (List Bool) × List Bool) => { payload := p.1, signature := p.2 }) (encTokenOfFields encM) (encTokenOf encM) 1 1
theorem Cslib.Crypto.AnonymousToken.encTokenOf_payload_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Token Message (List Bool) (List Bool)} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encTokenOf encM) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).payload) encIn✝ (encPayloadOf encM)
theorem Cslib.Crypto.AnonymousToken.encTokenOf_signature_budget {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Token Message (List Bool) (List Bool)} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encTokenOf encM) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).signature) encIn✝ Turing.MultiTapeTM.encBits S✝
theorem Cslib.Crypto.AnonymousToken.encTokenOf_mk_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Payload Message (List Bool)} {x1 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn (encPayloadOf encM)) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { payload := x0 x, signature := x1 x }) encIn (encTokenOf encM)
@[reducible, inline]

The tuple of the fields of encTokenOf.

theorem Cslib.Crypto.AnonymousToken.encTokenOf_payload_budget {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Token Message (List Bool) (List Bool)} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encTokenOf encM) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).payload) encIn✝ (encPayloadOf encM) S✝
theorem Cslib.Crypto.AnonymousToken.encBindingWitnessOf_mk_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 x1 : γ → Payload Message (List Bool)} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn (encPayloadOf encM)) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn (encPayloadOf encM)) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { first := x0 x, second := x1 x }) encIn (encBindingWitnessOf encM)
theorem Cslib.Crypto.AnonymousToken.encBindingWitnessOf_mk_deg {Message : Type} (encM : Message ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : Payload Message (List Bool) × Payload Message (List Bool)) => { first := p.1, second := p.2 }) (encBindingWitnessOfFields encM) (encBindingWitnessOf encM) 1 1

Encode a binding witness (first, second) over Payload Message (List Bool).

theorem Cslib.Crypto.AnonymousToken.encBindingWitnessOf_mk_inO {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Payload Message (List Bool)} {T0 S0 : γ → ℕ} {x1 : γ → Payload Message (List Bool)} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn (encPayloadOf encM) T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (encPayloadOf encM) T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { first := x0 x, second := x1 x }) encIn (encBindingWitnessOf encM) (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
theorem Cslib.Crypto.AnonymousToken.encBindingWitnessOf_first_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → BindingWitness Message (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.encBindingWitnessOf_mk_budget {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → Payload Message (List Bool)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn (encPayloadOf encM) budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (encPayloadOf encM) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { first := x0 x, second := x1 x }) encIn (encBindingWitnessOf encM) budget
theorem Cslib.Crypto.AnonymousToken.encBindingWitnessOf_first_budget {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → BindingWitness Message (List Bool)} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encBindingWitnessOf encM) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).first) encIn✝ (encPayloadOf encM) S✝
theorem Cslib.Crypto.AnonymousToken.encBindingWitnessOf_second_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → BindingWitness Message (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.encBindingWitnessOf_second_budget {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → BindingWitness Message (List Bool)} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encBindingWitnessOf encM) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).second) encIn✝ (encPayloadOf encM) S✝
@[reducible, inline]

The tuple of the fields of encBindingWitnessOf.

@[reducible, inline]

Encoding of one (payload, signature) entry in an extracted transcript.

@[reducible, inline]

Encoding of an extracted transcript log.

Appending one element to a framed list adds 2 * (enc x).length + 1 bits to its encoding length.

Encode an extracted execution (publicKey, output, log).

theorem Cslib.Crypto.AnonymousToken.encExecutionOf_mk_deg {Message : Type} (encM : Message ↪ List Bool) :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × Token Message (List Bool) (List Bool) × List (Payload Message (List Bool) × List Bool)) => { publicKey := p.1, output := p.2.1, log := p.2.2 }) (encExecutionOfFields encM) (encExecutionOf encM) 1 1
@[reducible, inline]

The tuple of the fields of encExecutionOf.

theorem Cslib.Crypto.AnonymousToken.encExecutionOf_mk_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {x1 : γ → Token Message (List Bool) (List Bool)} {x2 : γ → List (Payload Message (List Bool) × List Bool)} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn Turing.MultiTapeTM.encBits) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn (encTokenOf encM)) (h2 : Turing.MultiTapeTM.ComputableInPolyTime x2 encIn (encPayloadLogOf encM)) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { publicKey := x0 x, output := x1 x, log := x2 x }) encIn (encExecutionOf encM)
theorem Cslib.Crypto.AnonymousToken.encExecutionOf_publicKey_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Execution (List Bool) Message (List Bool) (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.encExecutionOf_publicKey_budget {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Execution (List Bool) Message (List Bool) (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.encExecutionOf_mk_budget {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List Bool} {x1 : γ → Token Message (List Bool) (List Bool)} {x2 : γ → List (Payload Message (List Bool) × List Bool)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn (encTokenOf encM) budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn (encPayloadLogOf encM) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { publicKey := x0 x, output := x1 x, log := x2 x }) encIn (encExecutionOf encM) budget
theorem Cslib.Crypto.AnonymousToken.encExecutionOf_output_budget {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Execution (List Bool) Message (List Bool) (List Bool)} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encExecutionOf encM) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).output) encIn✝ (encTokenOf encM) S✝
theorem Cslib.Crypto.AnonymousToken.encExecutionOf_log_budget {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Execution (List Bool) Message (List Bool) (List Bool)} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encExecutionOf encM) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).log) encIn✝ (encPayloadLogOf encM) S✝
theorem Cslib.Crypto.AnonymousToken.encExecutionOf_output_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Execution (List Bool) Message (List Bool) (List Bool)} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encExecutionOf encM) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).output) encIn✝ (encTokenOf encM)
theorem Cslib.Crypto.AnonymousToken.encExecutionOf_mk_inO {Message : Type} (encM : Message ↪ List Bool) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → Token Message (List Bool) (List Bool)} {T1 S1 : γ → ℕ} {x2 : γ → List (Payload Message (List Bool) × List Bool)} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (encTokenOf encM) T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (encPayloadLogOf encM) T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { publicKey := x0 x, output := x1 x, log := x2 x }) encIn (encExecutionOf encM) (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
theorem Cslib.Crypto.AnonymousToken.encExecutionOf_log_polyTime {Message : Type} (encM : Message ↪ List Bool) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Execution (List Bool) Message (List Bool) (List Bool)} :
Turing.MultiTapeTM.ComputableInPolyTime g✝ encIn✝ (encExecutionOf encM) → Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ✝) => (g✝ c).log) encIn✝ (encPayloadLogOf encM)
@[reducible, inline]

Encoding of a bit-string payload (msg, opening).

@[reducible, inline]

Encoding of a bit-string token (payload, signature).

@[reducible, inline]

Encoding of a bit-string binding witness.

@[reducible, inline]

Encoding of an optional bit-string binding witness.

@[reducible, inline]

Encoding of a public word pair (spk, ck) or (msg, sig).

@[reducible, inline]

Encoding of (n, ck) passed to parameterized collision and binding reductions.

@[reducible, inline]

Encoding of (n, (spk, ck)) supplied to parameterized anonymous-token reductions.

@[reducible, inline]

Encoding of ((n, ck), (pk, sk)) during logged execution against a word signature scheme.

@[reducible, inline]

Encoding of (n, L) supplied to signature-length bounds.

@[reducible, inline]

Encoding of (ck, (msg, opening)) supplied to keyed target encoders.

@[reducible, inline]

Encoding of (n, (ck, (msg, opening))) supplied to keyed target encoders.

@[reducible, inline]

Encoding of (n, (ck, (msg, opening))) supplied to keyed bit-string target encoders.

Total decoder for encPayloadOf encM given a total decoder for encM.

Word-level extracted forgers and targetForgerWord #

@[reducible, inline]

A word-level extracted forger receives (n, pkParam) and queries the word payload channel ((), encPayloadOf encM payload) for bit-string signatures, returning a Token.

Restrict a word-level extracted forger at verification key spk and auxiliary parameter ck encoded via encWordPair (spk, ck).

Interpret a word-level extracted forger as a typed ExtractedForger by processing every query as the Payload returned by the total decoder payloadDecoderOf D, rather than rejecting malformed query words (PartialDecoder), matching the oracle view simulated inside targetForgerWordOf.

def Cslib.Crypto.AnonymousToken.targetForgerWordOf {Message : Type} {encM : Message ↪ List Bool} (D : Turing.MultiTapeTM.Decoder encM) (sigBound : ℕ → ℕ → ℕ) (target : ℕ → List Bool → Message → List Bool → List Bool) (A : WordExtractedForgerOf Message) (n : ℕ) (keys : List Bool × List Bool) :

Generic word-level target-forgery reduction corresponding to targetForger: runs A on encWordPair (spk, ck), decodes each payload query with payloadDecoderOf D, forwards target n ck payload.message payload.opening to the signing oracle with reply truncation sigBound, and outputs (target n ck tok.payload.message tok.payload.opening, tok.signature).

theorem Cslib.Crypto.AnonymousToken.isOraclePPTOn_targetForgerWordOf {Message : Type} {encM : Message ↪ List Bool} (D : Turing.MultiTapeTM.Decoder encM) {sigBound : ℕ → ℕ → ℕ} (hsigBound : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : ℕ × ℕ) => sigBound p.1 p.2) encNatPair Turing.MultiTapeTM.encUnary) {target : ℕ → List Bool → Message → List Bool → List Bool} (htarget : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : ℕ × List Bool × Message × List Bool) => target p.1 p.2.1 p.2.2.1 p.2.2.2) (encTargetArgsOf encM) Turing.MultiTapeTM.encBits) {A : WordExtractedForgerOf Message} (hA : Probability.IsOraclePPT (encTokenOf encM) A) :

targetForgerWordOf is uniform strict oracle PPT on (n, (spk, ck)) whenever A, sigBound, and target are polynomial-time.

Word-level target-forgery reduction corresponding to targetForger: specializes targetForgerWordOf Decoder.bits.

targetForgerWord is uniform strict oracle PPT on (n, (spk, ck)) whenever A, sigBound, and target are polynomial-time.

theorem Cslib.Crypto.AnonymousToken.eval_eufCmaGame_targetForgerWord_eq (S : WordSignatureScheme) (target : ℕ → List Bool → List Bool → List Bool → List Bool) (sigBound : ℕ → ℕ → ℕ) (hbound : ∀ (n : ℕ) (pk sk : List Bool), (pk, sk) ∈ (S.keyGen n).eval.support → ∀ (msg sig : List Bool), sig ∈ (S.sign sk msg).eval.support → sig.length ≤ sigBound n msg.length) (A : WordExtractedForgerOf (List Bool)) (n : ℕ) (ck : List Bool) :

At every security parameter n and public parameter ck, targetForgerWord matches the typed Basic.targetForger reduction inside EUFCMA, provided sigBound bounds supported signature lengths of S.

bindingReductionWord and asymptotic extracted-token security #

def Cslib.Crypto.AnonymousToken.runExtractedWord {Message : Type} {encM : Message ↪ List Bool} (S : WordSignatureScheme) (target : ℕ → List Bool → Message → List Bool → List Bool) (D : Turing.MultiTapeTM.Decoder encM) (A : WordExtractedForgerOf Message) (n : ℕ) (ck : List Bool) :

Word-level logged execution corresponding to runExtracted: generates keys ← S.keyGen n, runs A on encWordPair (keys.1, ck) against S.sign keys.2 after decoding each request with payloadDecoderOf D, and records every semantic payload query and reply.

theorem Cslib.Crypto.AnonymousToken.isPPTOn_runExtractedWord {Message : Type} {encM : Message ↪ List Bool} (S : WordSignatureScheme) {target : ℕ → List Bool → Message → List Bool → List Bool} (htarget : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : ℕ × List Bool × Message × List Bool) => target p.1 p.2.1 p.2.2.1 p.2.2.2) (encTargetArgsOf encM) Turing.MultiTapeTM.encBits) (D : Turing.MultiTapeTM.Decoder encM) {A : WordExtractedForgerOf Message} (hA : Probability.IsOraclePPT (encTokenOf encM) A) :

runExtractedWord is uniform strict PPT in (n, ck) whenever target and A are efficient.

theorem Cslib.Crypto.AnonymousToken.eval_runExtractedWord_eq {Message : Type} {encM : Message ↪ List Bool} (S : WordSignatureScheme) (target : ℕ → List Bool → Message → List Bool → List Bool) (D : Turing.MultiTapeTM.Decoder encM) (A : WordExtractedForgerOf Message) (n : ℕ) (ck : List Bool) :
(runExtractedWord S target D A n ck).eval = (runExtracted (S.toScheme n) (target n ck) (WordExtractedForgerOf.toTyped D (A.atKey ck) n)).eval

runExtractedWord agrees in PMF law with Basic.runExtracted on S.toScheme n and WordExtractedForgerOf.toTyped.

Finding a binding witness in a transcript runs in plain polynomial time.

def Cslib.Crypto.AnonymousToken.bindingReductionWord {Message : Type} {encM : Message ↪ List Bool} (S : WordSignatureScheme) (target : ℕ → List Bool → Message → List Bool → List Bool) (D : Turing.MultiTapeTM.Decoder encM) (A : WordExtractedForgerOf Message) (n : ℕ) (ck : List Bool) :

Word-level binding reduction corresponding to Basic.bindingReduction: executes runExtractedWord and searches the transcript for a target collision with the output payload.

bindingReductionWord is uniform strict PPT in (n, ck).

theorem Cslib.Crypto.AnonymousToken.eval_bindingReductionWord_eq {Message : Type} {encM : Message ↪ List Bool} (S : WordSignatureScheme) (target : ℕ → List Bool → Message → List Bool → List Bool) (D : Turing.MultiTapeTM.Decoder encM) (A : WordExtractedForgerOf Message) (n : ℕ) (ck : List Bool) :
(bindingReductionWord S target D A n ck).eval = (bindingReduction (S.toScheme n) (target n ck) (WordExtractedForgerOf.toTyped D (A.atKey ck) n)).eval

bindingReductionWord has the exact PMF law of Basic.bindingReduction on S.toScheme n and WordExtractedForgerOf.toTyped.

Keyed word-level target function applying a collision-resistant hash H under key ck to the framed payload encWordPayload ⟨msg, opening⟩.

Key-sampling EUF-CMA wrapper around targetForgerWord for wordPayloadTarget H.

Collision finder extracted from bindingReductionWord by mapping some w to its two distinct encoded payloads (encWordPayload w.first, encWordPayload w.second).

Word-level extracted anonymous-token game: sample ck ← BitString.sampleList n, run runExtractedWord with wordPayloadTarget H, and accept when extractedAccept holds. Every bit-string oracle query from A is processed as the Payload returned by the total decoder payloadDecoderOf Decoder.bits (WordExtractedForgerOf.toTyped Decoder.bits), rather than rejecting malformed query words (PartialDecoder).

extractedTokenWordGame has the exact PMF law of sampling ck ← BitString.sampleList n and running extractedExperiment on (A.atKey ck).toTyped Decoder.bits n.

Word-level unforgeability of extracted anonymous tokens: assuming only S.EUFCMA, CollisionResistant H, and efficient H and A (with the signature length bound obtained internally from S.toSignatureScheme.exists_sign_length_bound), any oracle-PPT adversary has negligible winning probability in extractedTokenWordGame.

Extracted VOLE-ACT conservation: noteForgerWord #

Binary-credit encoding of semantic Credit.Notes with bit-string nullifiers and contexts.

theorem Cslib.Crypto.AnonymousToken.Conservation.encCreditNote_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 x2 T2 S2 x3 T3 S3 : γ → ℕ} (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.encNat T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encNat T3 S3) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { nullifier := x0 x, context := x1 x, credit := x2 x, refund := x3 x }) encIn encCreditNote (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))
theorem Cslib.Crypto.AnonymousToken.Conservation.encCreditNote_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List Bool} {x2 x3 : γ → ℕ} (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.encNat budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encNat budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { nullifier := x0 x, context := x1 x, credit := x2 x, refund := x3 x }) encIn encCreditNote budget
theorem Cslib.Crypto.AnonymousToken.Conservation.encCreditNote_nullifier_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Credit.Note (List Bool) (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.Conservation.encCreditNote_refund_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Credit.Note (List Bool) (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.Conservation.encCreditNote_credit_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Credit.Note (List Bool) (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.Conservation.encCreditNote_context_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Credit.Note (List Bool) (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.Conservation.encCreditNote_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × List Bool × ℕ × ℕ) => { nullifier := p.1, context := p.2.1, credit := p.2.2.1, refund := p.2.2.2 }) encCreditNoteFields encCreditNote 1 1
theorem Cslib.Crypto.AnonymousToken.Conservation.encIssueRequest_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 x1 T1 S1 : γ → ℕ} {x2 : γ → 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.encNat 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.encBits T4 S4) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { ctx := x0 x, amount := x1 x, commitment := x2 x, nullifier := x3 x, opening := x4 x }) encIn encIssueRequest (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))

Encoding of extracted issuance requests with binary credit amount.

theorem Cslib.Crypto.AnonymousToken.Conservation.encIssueRequest_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List Bool} {x1 : γ → ℕ} {x2 x3 x4 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat 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.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { ctx := x0 x, amount := x1 x, commitment := x2 x, nullifier := x3 x, opening := x4 x }) encIn encIssueRequest budget
theorem Cslib.Crypto.AnonymousToken.Conservation.encIssueRequest_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × ℕ × List Bool × List Bool × List Bool) => { ctx := p.1, amount := p.2.1, commitment := p.2.2.1, nullifier := p.2.2.2.1, opening := p.2.2.2.2 }) encIssueRequestFields encIssueRequest 1 1
theorem Cslib.Crypto.AnonymousToken.Conservation.encIssueRequest_ctx_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → IssueRequest (List Bool) (List Bool) (List Bool) (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.Conservation.encSpendRequest_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × List Bool × ℕ × ℕ × List Bool × ℕ × List Bool × ℕ × List Bool × List Bool × ℕ × List Bool) => { ctx := p.1, nullifier := p.2.1, debit := p.2.2.1, refund := p.2.2.2.1, changeCommitment := p.2.2.2.2.1, oldCredit := p.2.2.2.2.2.1, oldOpening := p.2.2.2.2.2.2.1, oldRefund := p.2.2.2.2.2.2.2.1, signature := p.2.2.2.2.2.2.2.2.1, newNullifier := p.2.2.2.2.2.2.2.2.2.1, newCredit := p.2.2.2.2.2.2.2.2.2.2.1, newOpening := p.2.2.2.2.2.2.2.2.2.2.2 }) encSpendRequestFields encSpendRequest 1 1

Encoding of extracted spend requests with binary credit, debit, and refund fields.

theorem Cslib.Crypto.AnonymousToken.Conservation.encSpendRequest_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List Bool} {x2 x3 : γ → ℕ} {x4 : γ → List Bool} {x5 : γ → ℕ} {x6 : γ → List Bool} {x7 : γ → ℕ} {x8 x9 : γ → List Bool} {x10 : γ → ℕ} {x11 : γ → 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.encNat budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encNat budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn Turing.MultiTapeTM.encBits budget) (h5 : Turing.MultiTapeTM.ComputableInSpace x5 encIn Turing.MultiTapeTM.encNat budget) (h6 : Turing.MultiTapeTM.ComputableInSpace x6 encIn Turing.MultiTapeTM.encBits budget) (h7 : Turing.MultiTapeTM.ComputableInSpace x7 encIn Turing.MultiTapeTM.encNat budget) (h8 : Turing.MultiTapeTM.ComputableInSpace x8 encIn Turing.MultiTapeTM.encBits budget) (h9 : Turing.MultiTapeTM.ComputableInSpace x9 encIn Turing.MultiTapeTM.encBits budget) (h10 : Turing.MultiTapeTM.ComputableInSpace x10 encIn Turing.MultiTapeTM.encNat budget) (h11 : Turing.MultiTapeTM.ComputableInSpace x11 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { ctx := x0 x, nullifier := x1 x, debit := x2 x, refund := x3 x, changeCommitment := x4 x, oldCredit := x5 x, oldOpening := x6 x, oldRefund := x7 x, signature := x8 x, newNullifier := x9 x, newCredit := x10 x, newOpening := x11 x }) encIn encSpendRequest budget
theorem Cslib.Crypto.AnonymousToken.Conservation.encSpendRequest_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 x2 T2 S2 x3 T3 S3 : γ → ℕ} {x4 : γ → List Bool} {T4 S4 x5 T5 S5 : γ → ℕ} {x6 : γ → List Bool} {T6 S6 x7 T7 S7 : γ → ℕ} {x8 : γ → List Bool} {T8 S8 : γ → ℕ} {x9 : γ → List Bool} {T9 S9 x10 T10 S10 : γ → ℕ} {x11 : γ → List Bool} {T11 S11 : γ → ℕ} (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.encNat T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encNat T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn Turing.MultiTapeTM.encBits T4 S4) (h5 : Turing.MultiTapeTM.ComputableInO x5 encIn Turing.MultiTapeTM.encNat T5 S5) (h6 : Turing.MultiTapeTM.ComputableInO x6 encIn Turing.MultiTapeTM.encBits T6 S6) (h7 : Turing.MultiTapeTM.ComputableInO x7 encIn Turing.MultiTapeTM.encNat T7 S7) (h8 : Turing.MultiTapeTM.ComputableInO x8 encIn Turing.MultiTapeTM.encBits T8 S8) (h9 : Turing.MultiTapeTM.ComputableInO x9 encIn Turing.MultiTapeTM.encBits T9 S9) (h10 : Turing.MultiTapeTM.ComputableInO x10 encIn Turing.MultiTapeTM.encNat T10 S10) (h11 : Turing.MultiTapeTM.ComputableInO x11 encIn Turing.MultiTapeTM.encBits T11 S11) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { ctx := x0 x, nullifier := x1 x, debit := x2 x, refund := x3 x, changeCommitment := x4 x, oldCredit := x5 x, oldOpening := x6 x, oldRefund := x7 x, signature := x8 x, newNullifier := x9 x, newCredit := x10 x, newOpening := x11 x }) encIn encSpendRequest (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + (T4 x + (T5 x + (T6 x + (T7 x + (T8 x + (T9 x + (T10 x + T11 x))))))))))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + (S4 x + (S5 x + (S6 x + (S7 x + (S8 x + (S9 x + (S10 x + S11 x))))))))))
theorem Cslib.Crypto.AnonymousToken.Conservation.encSpendRequest_ctx_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → SpendRequest (List Bool) (List Bool) (List Bool) (List Bool) (List Bool)} :
theorem Cslib.Crypto.AnonymousToken.Conservation.encSpendRequest_mk_polyTime {γ : Type} {encIn : γ ↪ List Bool} {x0 x1 : γ → List Bool} {x2 x3 : γ → ℕ} {x4 : γ → List Bool} {x5 : γ → ℕ} {x6 : γ → List Bool} {x7 : γ → ℕ} {x8 x9 : γ → List Bool} {x10 : γ → ℕ} {x11 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn Turing.MultiTapeTM.encBits) (h1 : Turing.MultiTapeTM.ComputableInPolyTime x1 encIn Turing.MultiTapeTM.encBits) (h2 : Turing.MultiTapeTM.ComputableInPolyTime x2 encIn Turing.MultiTapeTM.encNat) (h3 : Turing.MultiTapeTM.ComputableInPolyTime x3 encIn Turing.MultiTapeTM.encNat) (h4 : Turing.MultiTapeTM.ComputableInPolyTime x4 encIn Turing.MultiTapeTM.encBits) (h5 : Turing.MultiTapeTM.ComputableInPolyTime x5 encIn Turing.MultiTapeTM.encNat) (h6 : Turing.MultiTapeTM.ComputableInPolyTime x6 encIn Turing.MultiTapeTM.encBits) (h7 : Turing.MultiTapeTM.ComputableInPolyTime x7 encIn Turing.MultiTapeTM.encNat) (h8 : Turing.MultiTapeTM.ComputableInPolyTime x8 encIn Turing.MultiTapeTM.encBits) (h9 : Turing.MultiTapeTM.ComputableInPolyTime x9 encIn Turing.MultiTapeTM.encBits) (h10 : Turing.MultiTapeTM.ComputableInPolyTime x10 encIn Turing.MultiTapeTM.encNat) (h11 : Turing.MultiTapeTM.ComputableInPolyTime x11 encIn Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { ctx := x0 x, nullifier := x1 x, debit := x2 x, refund := x3 x, changeCommitment := x4 x, oldCredit := x5 x, oldOpening := x6 x, oldRefund := x7 x, signature := x8 x, newNullifier := x9 x, newCredit := x10 x, newOpening := x11 x }) encIn encSpendRequest
@[reducible, inline]

Sum encoding of IssueRequest ⊕ SpendRequest.

@[reducible, inline]

Tagged sum encoding of an extracted issuance/spend Request.

@[reducible, inline]

Encoding of a semantic note payload (note, opening).

@[reducible, inline]

Encoding of a semantic note token (payload, signature).

@[reducible, inline]

Encoding of a list of accepted Request records.

Inputs (nullifier, context, credit, opening) supplied to note commitment functions.

  • nullifier : List Bool

    Nullifier of the note being committed.

  • context : List Bool

    Issuance context of the note being committed.

  • credit : ℕ

    Credit balance committed in the note.

  • opening : List Bool

    Opening randomness of the commitment.

theorem Cslib.Crypto.AnonymousToken.Conservation.encComInput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 x2 T2 S2 : γ → ℕ} {x3 : γ → List Bool} {T3 S3 : γ → ℕ} (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.encNat T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encBits T3 S3) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { nullifier := x0 x, context := x1 x, credit := x2 x, opening := x3 x }) encIn encComInput (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))
theorem Cslib.Crypto.AnonymousToken.Conservation.encComInput_credit_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ComInput} :
theorem Cslib.Crypto.AnonymousToken.Conservation.encComInput_context_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ComInput} :
theorem Cslib.Crypto.AnonymousToken.Conservation.encComInput_nullifier_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ComInput} :
theorem Cslib.Crypto.AnonymousToken.Conservation.encComInput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List Bool} {x2 : γ → ℕ} {x3 : γ → 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.encNat budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { nullifier := x0 x, context := x1 x, credit := x2 x, opening := x3 x }) encIn encComInput budget
theorem Cslib.Crypto.AnonymousToken.Conservation.encComInput_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × List Bool × ℕ × List Bool) => { nullifier := p.1, context := p.2.1, credit := p.2.2.1, opening := p.2.2.2 }) encComInputFields encComInput 1 1
theorem Cslib.Crypto.AnonymousToken.Conservation.encComInput_opening_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → ComInput} :

Framed layout encoding of ComInput, keeping the nested layout encPair encBits (encPair encBits (encPair encNat encBits)).

@[reducible, inline]

Encoding of ((n, ck), comInput) supplied to keyed note commitments.

@[reducible, inline]

Encoding of (commitment, refund) passed to commitment-refund taggers.

@[reducible, inline]

Encoding of a handler invocation (caller, req, accepted) in noteForgerWord.

@[reducible, inline]

Encoding of a handler result (replyWord, accepted) in noteForgerWord.

Canonical injective word tag pairing a commitment word and binary refund natural number.

wordTag is injective as a function of (commitment, refund).

Lift a WordSignatureScheme at security parameter n via tag to a typed scheme signing (commitment, refund) pairs.

@[reducible, inline]

A word-level extracted VOLE-ACT adversary querying encoded Requests for encoded Option Sig replies and outputting a context ctx : List Bool.

Interpret a word-level conservation adversary as a typed ExtractedAdversary at (n, ck) by processing every word query as the Request returned by the total decoder wordRequestDecoder, rather than rejecting malformed query words (PartialDecoder), matching the oracle view simulated inside noteForgerHandlerWord.

theorem Cslib.Crypto.AnonymousToken.Conservation.computableInPolyTime_requestElim {γ δ : Type} {encG : γ ↪ List Bool} {encD : δ ↪ List Bool} {req : γ → Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool)} {f : γ → δ} (onIssue : γ → IssueRequest (List Bool) (List Bool) (List Bool) (List Bool) → δ) (onSpend : γ → SpendRequest (List Bool) (List Bool) (List Bool) (List Bool) (List Bool) → δ) (hreq : Turing.MultiTapeTM.ComputableInPolyTime req encG encWordRequest) (hi : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : γ × IssueRequest (List Bool) (List Bool) (List Bool) (List Bool)) => onIssue p.1 p.2) (Turing.MultiTapeTM.encPair encG encIssueRequest) encD) (hs : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : γ × SpendRequest (List Bool) (List Bool) (List Bool) (List Bool) (List Bool)) => onSpend p.1 p.2) (Turing.MultiTapeTM.encPair encG encSpendRequest) encD) (hf : ∀ (g : γ), f g = Sum.elim (onIssue g) (onSpend g) (requestEquiv (req g))) :

Dependent case elimination on a computed Request runs in plain polynomial time whenever both the .issue and .spend branches do.

Parameterized stateful handler for word-level note-forgery reductions: decodes each Request, checks accept, queries the external note signing oracle with sigBound-truncation on computed target length, and records accepted requests.

theorem Cslib.Crypto.AnonymousToken.Conservation.isOraclePPTOn_noteForgerHandlerWordOf {sigBound : ℕ → ℕ → ℕ} (hsigBound : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : ℕ × ℕ) => sigBound p.1 p.2) encNatPair Turing.MultiTapeTM.encUnary) {accept : ℕ → List Bool → List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool)) → Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool) → Bool} (haccept : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : (ℕ × List Bool) × List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool)) × Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool)) => accept p.1.1 p.1.2 p.2.1 p.2.2) (Turing.MultiTapeTM.encPair encParamInput (Turing.MultiTapeTM.encPair encRequestLog encWordRequest)) Turing.MultiTapeTM.encBool) {target : ℕ → List Bool → Payload (Credit.Note (List Bool) (List Bool)) (List Bool) → List Bool} (htarget : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : (ℕ × List Bool) × Payload (Credit.Note (List Bool) (List Bool)) (List Bool)) => target p.1.1 p.1.2 p.2) (Turing.MultiTapeTM.encPair encParamInput encNotePayload) Turing.MultiTapeTM.encBits) :
Probability.IsOraclePPTOn encRequestCall encRequestReply fun (x : (ℕ × List Bool) × (Unit × List Bool) × List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool))) => match x with | (caller, req, accepted) => noteForgerHandlerWordOf sigBound accept target caller.1 caller.2 req accepted

noteForgerHandlerWordOf is uniform strict oracle PPT whenever sigBound, accept, and target are computable in polynomial time.

theorem Cslib.Crypto.AnonymousToken.Conservation.mem_support_noteForgerHandlerWordOf_length_le {sigBound : ℕ → ℕ → ℕ} {accept : ℕ → List Bool → List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool)) → Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool) → Bool} {target : ℕ → List Bool → Payload (Credit.Note (List Bool) (List Bool)) (List Bool) → List Bool} (caller : ℕ × List Bool) (req : Unit × List Bool) (accepted : List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool))) (res : List Bool × List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool))) (hres : res ∈ OracleComp.support (noteForgerHandlerWordOf sigBound accept target caller.1 caller.2 req accepted)) :

Every transition of noteForgerHandlerWordOf increases encRequestLog by at most one decoded request plus framing overhead.

Generic execution phase for word-level note-forgery reductions, running A n keys under handler n keys.

Generic word-level note-forgery reduction extracting the first uncertified spend note after noteForgerRunOf handler A.

theorem Cslib.Crypto.AnonymousToken.Conservation.isOraclePPTOn_noteForgerWordOf {handler : ℕ → List Bool → Unit × List Bool → List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool)) → Probability.WordOracleComp Unit (List Bool × List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool)))} (hhandler : Probability.IsOraclePPTOn encRequestCall encRequestReply fun (x : (ℕ × List Bool) × (Unit × List Bool) × List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool))) => match x with | (caller, req, accepted) => handler caller.1 caller.2 req accepted) (hstep : ∀ (caller : ℕ × List Bool) (req : Unit × List Bool) (accepted : List (Request (List Bool) (List Bool) (List Bool) (List Bool) (List Bool))), ∀ res ∈ OracleComp.support (handler caller.1 caller.2 req accepted), (encRequestLog res.2).length ≤ (encRequestLog accepted).length + 2 * (encWordRequest (wordRequestDecoder.decode req.2)).length + 2) {A : WordExtractedAdversary} (hA : Probability.IsOraclePPT Turing.MultiTapeTM.encBits A) :

noteForgerWordOf handler is uniform strict oracle PPT whenever handler is uniform strict oracle PPT with linear request-log growth per call.

Stateful handler used by noteForgerWord: decodes each Request, checks acceptRequest against pairScheme S tag, queries the external note signing oracle with sigBound-truncation on accepted requests, and records accepted requests.

Word-level semantic note-forgery reduction corresponding to Conservation.noteForger: runs A against noteForgerHandlerWord and extracts the first uncertified spend note via findNoteForgery.

theorem Cslib.Crypto.AnonymousToken.Conservation.eval_runExtracted_noteForgerWord_eq (S : WordSignatureScheme) (sigBound : ℕ → ℕ → ℕ) (hbound : ∀ (n : ℕ) (pk sk : List Bool), (pk, sk) ∈ (S.keyGen n).eval.support → ∀ (msg sig : List Bool), sig ∈ (S.sign sk msg).eval.support → sig.length ≤ sigBound n msg.length) (com : ℕ → List Bool → List Bool → List Bool → ℕ → List Bool → List Bool) (tag : List Bool → ℕ → List Bool) (A : WordExtractedAdversary) (n : ℕ) (ck : List Bool) :
(runExtractedWord S (fun (m : ℕ) (c : List Bool) (note : Credit.Note (List Bool) (List Bool)) (opening : List Bool) => tag (com m c note.nullifier note.context note.credit opening) note.refund) creditNoteDecoder (noteForgerWord sigBound com tag S A) n ck).eval = (runExtracted (pairScheme S tag n) (Credit.target (com n ck) Prod.mk) (noteForger (com n ck) Prod.mk (pairScheme S tag n) (A.toTyped n ck))).eval

Under runExtractedWord, noteForgerWord agrees in PMF law with Conservation.noteForger on pairScheme S tag n and WordExtractedAdversary.toTyped, provided sigBound bounds supported signature lengths of S.

Extracted VOLE-ACT conservation: commitmentBindingReductionWord and headline #

@[reducible, inline]

Binary encoding of (nullifier, context, credit) message triples committed by wordNoteCom.

theorem Cslib.Crypto.AnonymousToken.Conservation.encWordBindingCollision_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × (List Bool × List Bool × ℕ) × List Bool × (List Bool × List Bool × ℕ) × List Bool) => { commitment := p.1, msg₀ := p.2.1, opening₀ := p.2.2.1, msg₁ := p.2.2.2.1, opening₁ := p.2.2.2.2 }) encWordBindingCollisionFields encWordBindingCollision 1 1
theorem Cslib.Crypto.AnonymousToken.Conservation.encWordBindingCollision_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → List Bool} {x1 : γ → List Bool × List Bool × ℕ} {x2 : γ → List Bool} {x3 : γ → List Bool × List Bool × ℕ} {x4 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn encWordComMessage budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn encWordComMessage budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { commitment := x0 x, msg₀ := x1 x, opening₀ := x2 x, msg₁ := x3 x, opening₁ := x4 x }) encIn encWordBindingCollision budget
theorem Cslib.Crypto.AnonymousToken.Conservation.encWordBindingCollision_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool × List Bool × ℕ} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} {x3 : γ → List Bool × 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 encWordComMessage T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn encWordComMessage T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn Turing.MultiTapeTM.encBits T4 S4) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { commitment := x0 x, msg₀ := x1 x, opening₀ := x2 x, msg₁ := x3 x, opening₁ := x4 x }) encIn encWordBindingCollision (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))

Encoding of a commitment binding collision over (nullifier, context, credit) triples.

def Cslib.Crypto.AnonymousToken.Conservation.noteTarget (com : ℕ → List Bool → List Bool → List Bool → ℕ → List Bool → List Bool) (tag : List Bool → ℕ → List Bool) (m : ℕ) (c : List Bool) (note : Credit.Note (List Bool) (List Bool)) (opening : List Bool) :

Two-stage target mapping a semantic Credit.Note and opening via com and tag.

Word-level commitment-binding reduction corresponding to Conservation.commitmentBindingReduction: runs bindingReductionWord on noteForgerWord under noteTarget com tag and maps any resulting witness via Conservation.noteBindingCollisionOrTrivial.

theorem Cslib.Crypto.AnonymousToken.Conservation.eval_commitmentBindingReductionWord_eq {K : Type} (S : WordSignatureScheme) (sigBound : ℕ → ℕ → ℕ) (hbound : ∀ (n : ℕ) (pk sk : List Bool), (pk, sk) ∈ (S.keyGen n).eval.support → ∀ (msg sig : List Bool), sig ∈ (S.sign sk msg).eval.support → sig.length ≤ sigBound n msg.length) (com : ℕ → List Bool → List Bool → List Bool → ℕ → List Bool → List Bool) (tag : List Bool → ℕ → List Bool) (htag : Function.Injective fun (p : List Bool × ℕ) => tag p.1 p.2) (A : WordExtractedAdversary) (n : ℕ) (ck : List Bool) (k : K) :
(commitmentBindingReductionWord sigBound com tag S A n ck).eval = (commitmentBindingReduction (com n ck) (pairScheme S tag n) (A.toTyped n ck) k).eval

commitmentBindingReductionWord has the exact PMF law of Conservation.commitmentBindingReduction at (com n ck) and pairScheme S tag n, provided sigBound bounds signature lengths of S and tag is injective.

theorem Cslib.Crypto.AnonymousToken.Conservation.eval_eufCmaGame_noteForgerWord_eq (S : WordSignatureScheme) (sigBound : ℕ → ℕ → ℕ) (hbound : ∀ (n : ℕ) (pk sk : List Bool), (pk, sk) ∈ (S.keyGen n).eval.support → ∀ (msg sig : List Bool), sig ∈ (S.sign sk msg).eval.support → sig.length ≤ sigBound n msg.length) (com : ℕ → List Bool → List Bool → List Bool → ℕ → List Bool → List Bool) (tag : List Bool → ℕ → List Bool) (htag : Function.Injective fun (p : List Bool × ℕ) => tag p.1 p.2) (A : WordExtractedAdversary) (n : ℕ) (ck : List Bool) :
(S.eufCmaGame (fun (m : ℕ) (spk : List Bool) => targetForgerWordOf creditNoteDecoder sigBound (noteTarget com tag) (noteForgerWord sigBound com tag S A) m (spk, ck)) n).eval = ProbComp.eval ((pairScheme S tag n).eufCmaExperiment (targetForger (Credit.target (com n ck) Prod.mk) (noteForger (com n ck) Prod.mk (pairScheme S tag n) (A.toTyped n ck))))

At every security parameter n and public parameter ck, wrapping noteForgerWord inside targetForgerWordOf creditNoteDecoder sigBound (noteTarget com tag) matches S.eufCmaExperiment of Basic.targetForger on Conservation.noteForger, provided sigBound bounds signature lengths of S and tag is injective.

def Cslib.Crypto.AnonymousToken.Conservation.wordNoteCom (H : List Bool → List Bool → List Bool) :
ℕ → (ck nullifier ctx : List Bool) → (credit : ℕ) → (opening : List Bool) → List Bool

Keyed hash-based note commitment applying H ck to the framed ComInput word encComInput ⟨nullifier, ctx, credit, opening⟩.

Key-sampling EUF-CMA wrapper around noteForgerWord using wordNoteCom H and wordTag.

Maps a commitment binding collision (m₀, r₀, m₁, r₁) to the framed ComInput word pair (encComInput ..., encComInput ...) for wordNoteCom.

Collision finder extracted from commitmentBindingReductionWord by mapping each commitment binding collision (c, m₀, r₀, m₁, r₁) via noteCollisionToPair.

Word-level extracted VOLE-ACT credit-conservation game: sample ck ← BitString.sampleList n and run Conservation.extractedConservationExperiment with wordNoteCom H n ck, pairScheme S wordTag n, and A.toTyped n ck. Every bit-string oracle query from A is processed as the Request returned by the total decoder wordRequestDecoder (WordExtractedAdversary.toTyped), rather than rejecting malformed words (PartialDecoder).

Word-level credit conservation in the extracted VOLE-ACT model: assuming only S.EUFCMA, CollisionResistant H, and efficient H and A (with the signature length bound obtained internally from S.toSignatureScheme.exists_sign_length_bound), any oracle-PPT adversary has negligible probability of violating credit conservation in extractedConservationWordGame.