Forking Lemma #
This file provides a general forking lemma for adversaries in the Random Oracle Model (ROM) with a single oracle query (q = 1).
Overview #
The forking lemma (Bellare-Neven 2006, Pointcheval-Stern 2000) is a key tool for
security reductions of signature schemes in the ROM. It shows that if an adversary
succeeds with probability acc, then running the adversary twice with the same
randomness but different oracle responses produces two accepting transcripts with
probability at least acc² - acc/|R|.
Model #
We decompose the adversary into two phases:
- Commit phase (
coins): Probabilistic; produces a commitmentcusing internal randomness. This models everything the adversary does before the oracle query. - Response phase (
respond): Deterministic; given the commitmentcand oracle responsee, produces the final outputy. This models the adversary's computation after receiving the oracle response.
The forking algorithm:
- Run
coinsonce to get commitmentc - Sample two independent oracle responses
e₁, e₂ ← uniform R - Compute
y₁ = respond(x, c, e₁)andy₂ = respond(x, c, e₂) - Succeed if both
accept(y₁)andaccept(y₂)ande₁ ≠ e₂
Since the commit phase is shared, both runs produce the same commitment, enabling special soundness extraction from the two accepting transcripts.
Main results #
ForkableAdversary- Two-phase adversary structureforkAlg- The forking algorithmjensen_sub_pmf_sq- Jensen's inequality:E[f²] ≥ (E[f])²for sub-PMF weightsfork_success_ge- Forking lemma: fork success probability ≥acc² - acc/|R|
References #
- [Bellare, Neven, Multi-signatures in the plain public-key model]
- [Pointcheval, Stern, Security arguments for digital signatures and blind signatures]
- [Firsov, Unruh, Reflection, rewinding, and coin-toss in EasyCrypt]
Forkable Adversary Model #
Two-phase adversary for the ROM forking lemma (q = 1 oracle query).
The adversary is decomposed into:
coins: Probabilistic commitment phase (uses internal randomness)respond: Deterministic response phase (given commitment and oracle response)
This decomposition enables forking: replay the adversary with the same commitment but a different oracle response.
- coins : X → Core.SPComp C
Phase 1: Probabilistic commitment. Given input
x, produce commitmentc. - respond : X → C → R → Y
Phase 2: Deterministic response. Given input
x, commitmentc, and oracle responser, produce outputy.
Instances For
Run the adversary: commit then respond with a uniform oracle sample.
Equations
- A.run x = do let c ← A.coins x let e ← CatCrypt.Core.SPComp.sample R CatCrypt.Core.SPComp.pure (A.respond x c e)
Instances For
Acceptance probability of the adversary.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The forking algorithm: run the adversary twice with shared commitment but independent oracle responses.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Fork success probability: both runs accept and oracle responses differ.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Jensen's Inequality for ENNReal #
The key mathematical ingredient for the forking lemma is Jensen's inequality
for the convex function x² under sub-probability weights:
(∑ w(i) * f(i))² ≤ ∑ w(i) * f(i)²
when ∑ w(i) ≤ 1 and f(i) ≤ 1.
The proof uses the AM-GM inequality pointwise.
Jensen's inequality for squaring under sub-PMF weights.
For weights w with ∑ w ≤ 1 and bounded function f ≤ 1:
(∑ w(i) * f(i))² ≤ ∑ w(i) * f(i)²
Proof: By AM-GM, 2 * f(i) * μ ≤ f(i)² + μ². Multiply by w(i) and sum:
2μ² ≤ E[f²] + (∑ w) * μ² ≤ E[f²] + μ²
Cancel μ² (finite since μ ≤ 1) to get μ² ≤ E[f²].
Representation Lemmas #
prTrue of a bind decomposes as a weighted sum over the PMF of the first computation.
prTrue of sampling from R then applying a pure Boolean function.
Monotonicity Lemmas for prTrue #
If Q → R, then prTrue(pure(decide Q)) ≤ prTrue(pure(decide R)).
Monotonicity of prTrue under bind:
if k₁ is pointwise ≤ k₂, then bind c k₁ ≤ bind c k₂.
Scaled monotonicity: if prTrue(k₁ a) ≤ c * prTrue(k₂ a) pointwise,
then prTrue(bind comp k₁) ≤ c * prTrue(bind comp k₂).
Lower bound: sampling then testing has probability ≥ 1/|R| times any witness's probability.
Forking Lemma #
Conditional acceptance probability for a fixed commitment c.
Equations
- CatCrypt.Crypto.ForkingLemma.condAccProb A x accept c h₀ = CatCrypt.Crypto.prTrue ((CatCrypt.Core.SPComp.sample R).bind fun (e : R) => CatCrypt.Core.SPComp.pure (accept (A.respond x c e))) h₀
Instances For
Conditional fork success probability for a fixed commitment c.
Equations
- One or more equations did not get rendered due to their size.
Instances For
prTrue of two independent samples from R then applying a pure Boolean function. The result counts accepting pairs divided by N².
The conditional fork probability equals acc_c² - acc_c/|R| (exact counting).
Acceptance probability decomposes over commitments.
Fork success probability decomposes over commitments.
Main forking lemma (q = 1): the fork success probability is at least acc² - acc/|R|.
This is the Bellare-Neven bound specialized to a single oracle query:
Pr[fork succeeds] ≥ acc · (acc - 1/|R|) = acc² - acc/|R|
where acc is the adversary's acceptance probability and |R| is the size
of the oracle response space.