Documentation

CslibFrontier.Crypto.Computational.TCRSignature

Target collision-resistant hash-and-sign and stateless signatures from one-way permutations #

When hashing messages before signing under a target collision-resistant hash family (UOWHF), placing a single hash key in the public verification key fails: an adversary seeing k in pk before choosing its signing query and forgery could search for full collisions rather than target collisions. Instead, construction (13.2) of [BS23], Section 13.2.1 (p. 533) samples a fresh hash key k inside every signature and signs the pair (k, H(k, m)):

Main definitions #

Main results #

References #

Injective one-time parameter schedule and (k, digest) message encoding #

Total bit budget H.keyLen n + H.digestLen n signed under the one-time signature scheme at security parameter n.

Injective one-time signature security parameter strictly above otsBudget H n.

Polynomial-time bounded-search left inverse of otsParam H.

Encode (k, d) as an exact otsParam H n-bit word by concatenating the H.keyLen n-bit fixed view of k, the H.digestLen n-bit fixed view of d, and otsParam H n - otsBudget H n trailing false bits.

theorem Cslib.Crypto.TCRSignature.otsMsg_inj (H : KeyedHashFamily) {n : ℕ} {k₁ d₁ k₂ d₂ : List Bool} (hk₁ : k₁.length = H.keyLen n) (hd₁ : d₁.length = H.digestLen n) (hk₂ : k₂.length = H.keyLen n) (hd₂ : d₂.length = H.digestLen n) (heq : otsMsg H n k₁ d₁ = otsMsg H n k₂ d₂) :
k₁ = k₂ ∧ d₁ = d₂

The capacity-1 fresh-key TCR hash-and-sign scheme #

Translate a (msg, sig) word pair at parameter n into the underlying fixed-length (otsMsg H n k (H.eval n k msg), ots) forgery candidate for S.

Sample a one-time key pair (otvk, otsk) ← S.keyGen (otsParam H n) and bundle n with each half via encPair encUnary encBits.

noncomputable def Cslib.Crypto.TCRSignature.sign (S : SignatureScheme) (H : KeyedHashFamily) (sk : List Bool) (u : ℕ) (msg : List Bool) :

Sign msg at index 0 by sampling a fresh H.keyLen n-bit key k, signing otsMsg H n k (H.eval n k msg) under S.sign, and returning encPair encBits encBits (k, ots). Returns [] for every index u ≥ 1.

Verify sig on msg at index u under pk: require u == 0, k.length == H.keyLen n, and S.verify otvk (otsMsg H n k (H.eval n k msg)) ots.

theorem Cslib.Crypto.TCRSignature.verify_sign (S : SignatureScheme) (H : KeyedHashFamily) (n : ℕ) (keys : List Bool × List Bool) (hkeys : keys ∈ (keyGen S H n).eval.support) (u : ℕ) (hu : u < 1) (msg sig : List Bool) (hsig : sig ∈ (sign S H keys.2 u msg).eval.support) :
verify S H keys.1 u msg sig = true

Fresh-key TCR hash-and-sign capacity-1 indexed signature scheme ([BS23], Section 13.2.1, construction (13.2) instantiated over a one-time signature scheme S and an unrestricted KeyedHashFamily H): signs arbitrary-length List Bool messages at index 0 by sampling a fresh hash key k per signature and signing (k, H.eval n k msg) under S at otsParam H n.

@[simp]

scheme S H has capacity 1 at every security parameter.

@[simp]

Key generation of scheme S H is keyGen S H.

@[simp]

Signing of scheme S H is sign S H.

@[simp]

Verification of scheme S H is verify S H.

Deterministic coin-driven simulator for capacity-1 indexed runs #

theorem Cslib.Crypto.TCRSignature.computableInPolyTime_finiteConfig_cases {k : ℕ} {Control α β : Type} [Finite Control] {encIn : α ↪ List Bool} {encOut : β ↪ List Bool} (machine : Turing.MultiTapePTM k Bool Control Unit) {cfg : α → Turing.MultiTapeMachine.FiniteConfig k Bool Control Unit} {coin : α → Bool} (hcfg : Turing.MultiTapeTM.ComputableInPolyTime cfg encIn Turing.MultiTapeTM.encFiniteConfig) (hcoin : Turing.MultiTapeTM.ComputableInPolyTime coin encIn Turing.MultiTapeTM.encBool) {onHalt : α → β} (hHalt : Turing.MultiTapeTM.ComputableInPolyTime onHalt encIn encOut) {onStep : Turing.Action k Bool Control → (Unit → Option Bool) → (Unit → SignType) → α → β} (hStep : ∀ (action : Turing.Action k Bool Control) (symbol : Unit → Option Bool) (move : Unit → SignType), Turing.MultiTapeTM.ComputableInPolyTime (onStep action symbol move) encIn encOut) {onQuery : Control → α → β} (hQuery : ∀ (next : Control), Turing.MultiTapeTM.ComputableInPolyTime (onQuery next) encIn encOut) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : α) => match (cfg a).tapes.state with | none => onHalt a | some state => match machine.tr state (cfg a).tapes.inputSymbol (cfg a).tapes.workTapeSymbols (cfg a).answerSymbols (coin a) with | Turing.MultiTapeMachine.Action.step action symbol move => onStep action symbol move a | Turing.MultiTapeMachine.Action.query PUnit.unit next => onQuery next a) encIn encOut

Finite-tag transition dispatch on FiniteConfig: given polynomial-time projections for a FiniteConfig cfg and a coin coin, plus polynomial-time handlers for the halted branch, each (action, symbol, move) step branch, and each next query branch, the full transition is computable in polynomial time.

One deterministic transition of machine on finite storage (cfg, qOpt) using fair coin coin and pre-supplied reply for the first query at index 0 (r.1 == 0 && qOpt.isNone). Every other query (r.1 ≠ 0 or after qOpt = some m₀) receives the empty reply [], matching indexedSigningOracle at capacity 1.

def Cslib.Crypto.TCRSignature.simRun {k : ℕ} {Control : Type} (machine : Turing.MultiTapePTM k Bool Control Unit) (word reply coins : List Bool) :

Run machine deterministically on word over coins using reply for the first valid index-0 signing query, returning (finalOutput, recordedQuery).

simRun is computable in plain polynomial time for every finite-control MultiTapePTM.

Exact coupling between finiteStep and simStep #

The two reductions: oneTimeForger and tcrAdversary #

Total decoder for raw IndexedForger outputs (u, msg, sig).

Bundled public key (n, otvk) passed to an adversary against scheme or wordScheme.

Encoded machine input (n, simPkOf n otvk) for a simulated adversary run.

Polynomial step/reply budget c * ((simWordOf n otvk).length + 1) ^ d on (n, otvk).

noncomputable def Cslib.Crypto.TCRSignature.oneTimeForger {k : ℕ} {Control : Type} (H : KeyedHashFamily) (sigBound : ℕ → ℕ) (machine : Turing.MultiTapePTM k Bool Control Unit) (c d : ℕ) :

One-time signature forger at security parameter M = otsParam H n: recovers n := otsParamInv H M, samples coins and a uniform hash key k, dry-runs simRun on [], queries its external one-time signing oracle at most once on otsMsg H n k (H.eval n k m₀) (with reply truncated to sigBound n), replays simRun, and outputs (otsMsg H n k' (H.eval n k' m₁), ots').

noncomputable def Cslib.Crypto.TCRSignature.tcrAdversary {k : ℕ} {Control : Type} (S : SignatureScheme) (H : KeyedHashFamily) (machine : Turing.MultiTapePTM k Bool Control Unit) (c d : ℕ) :

Two-stage target-collision adversary against H: choose n samples keys ← S.keyGen (otsParam H n) and coins, dry-runs simRun on [] to commit the first valid signing query m₀ before k is chosen, and saves (keys, coins); find n state k signs (k, H.eval n k m₀) locally using keys.2, replays simRun on the same coins, and outputs the forged message m₁.

oneTimeForger is uniformly strict oracle PPT whenever sigBound is computable in plain polynomial time on unary n.

theorem Cslib.Crypto.TCRSignature.isPPT_tcrAdversary {k : ℕ} {Control : Type} [Finite Control] (S : SignatureScheme) (H : KeyedHashFamily) (machine : Turing.MultiTapePTM k Bool Control Unit) (c d : ℕ) :
(tcrAdversary S H machine c d).IsPPT

Both stages of tcrAdversary are uniformly strict PPT.

Security bound and existential upgrades #

theorem Cslib.Crypto.TCRSignature.succProbability_indexedEufCmaGame_le_of_machine {k : ℕ} {Control : Type} (S : SignatureScheme) (H : KeyedHashFamily) (sigBound : ℕ → ℕ) (hsigBound : ∀ (n : ℕ), ∀ keys ∈ (S.keyGen (otsParam H n)).eval.support, ∀ (msg : List Bool), msg.length = otsParam H n → ∀ ots ∈ (S.sign keys.2 msg).eval.support, ots.length ≤ sigBound n) (adversary : IndexedForger) (machine : Turing.MultiTapePTM k Bool Control Unit) (c d : ℕ) (hmachine : ∀ (input : ℕ × List Bool) (State : Type) (oracle : Unit × List Bool → StateT State PMF (List Bool)) (s : State), (OracleComp.interpret (OracleComp.sumHandler (fun (m : ℕ) => StateT.lift (ProbComp.unifOracle m)) oracle) (⇑encIndexedSignedMessage <$> adversary input.1 input.2)).run s = (OracleComp.interpret (OracleComp.sumHandler (fun (m : ℕ) => StateT.lift (ProbComp.unifOracle m)) oracle) (machine.runOracle (c * (((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encBits) input).length + 1) ^ d) ((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encBits) input))).run s) (n : ℕ) :

Concrete security bound for TCRSignature.scheme with an explicit realizing machine ([BS23], Section 13.2.1, Theorem 13.2): at every security parameter n, the indexed forging probability against scheme S H is at most the one-time forging probability of oneTimeForger against S at otsParam H n plus the target-collision probability of tcrAdversary against H at n.

theorem Cslib.Crypto.TCRSignature.exists_ots_bounds (S : SignatureScheme) (H : KeyedHashFamily) :
∃ (ckg : ℕ) (dkg : ℕ) (sigBound : ℕ → ℕ), Turing.MultiTapeTM.ComputableInPolyTime sigBound Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary ∧ (∀ (n : ℕ), ∀ keys ∈ (S.keyGen (otsParam H n)).eval.support, keys.1.length ≤ ckg * (otsParam H n + 1) ^ dkg) ∧ ∀ (n : ℕ), ∀ keys ∈ (S.keyGen (otsParam H n)).eval.support, ∀ (msg : List Bool), msg.length = otsParam H n → ∀ ots ∈ (S.sign keys.2 msg).eval.support, ots.length ≤ sigBound n

Polynomial-time upper bounds on one-time verification keys and signatures sampled at otsParam H n.

Existential reduction for TCRSignature.scheme, after the proof of [BS23], Theorem 13.2, with one signing query: every strict oracle-PPT indexed forger adversary induces a strict oracle-PPT one-time forger otForger and a strict PPT two-stage TargetCollisionFinder tcrAdv bounding adversary's indexed forging probability at every security parameter n.

Any Negligible function remains Negligible after precomposing with otsParam H.

One-time form of [BS23], Theorem 13.2 (Section 13.2.1, p. 534): a step, not the cited result. The source states Theorem 13.2 for a many-time secure S and concludes many-time security of the derived scheme; that statement is SignatureScheme.EUFCMA.eufCMA_wordScheme. For one-time signatures it only remarks that short messages suffice "as discussed in Section 13.2" (p. 584). Here, if S is one-time EUF-CMA secure (OneTimeEUFCMA, Definition 14.1) and H is target collision resistant on every word, then construction (13.2) over S, as the capacity-1 indexed scheme TCRSignature.scheme S H on messages of any length, is one-time secure (IndexedEUFCMA at the single index 0). The proof is the source's case split with one signing query. As in eufCMA_wordScheme, S runs at the parameter otsParam H n on the zero-padded word of (r, H(r, m)). This is the first step of the route from one-way functions and target collision resistant hashing to many-time signatures (OneWay.exists_eufCMA_of_targetCollisionResistant; #5686).

Capacity-2 indexed signatures from one-way functions and target collision-resistant hash families: combining Lamport's one-time signature scheme (OneWay.exists_oneTimeSignature), TCRSignature.scheme, and IndexedSignatureScheme.double yields a capacity-2 IndexedEUFCMA scheme without collision-resistant hashing.

Step toward the signatures of [NY89], Section 4, not the cited result: no inspection of the primary source is recorded (manual/sources.md lists the authors' manuscript without a check), so this statement has not been checked against it (#5293). [BS23], Sections 13.2.1 and 14.6, give the route but state no theorem of this form.

Any one-way function and any unrestricted target collision-resistant KeyedHashFamily yield a stateless many-time SignatureScheme satisfying EUFCMA.

Step toward the Naor–Yung signature theorem ([NY89], Theorem 2 / Section 4), not the cited result: no inspection of the primary source is recorded (manual/sources.md lists the authors' manuscript without a check), so this statement has not been checked against it (#5293).

Every one-way permutation implies the existence of a stateless many-time EUFCMA-secure digital signature scheme, with no separate hash-family assumption.