Forking Lemma #
The forking lemma is a key tool in provable security. Given an adversary that succeeds with some probability, the "fork" runs it twice with shared randomness up to a chosen query index, then re-samples one oracle response, bounding the probability that both runs succeed.
API changes from old version #
OracleCompno longer hasAlternative, soguard/getMare unavailable.forknow returnsOracleComp spec (Option (α × α))with explicit matching.seededOracleusesStateT(notReaderT), so.run' seeddiscards the final state.- Old probability notation
[= x | ...]→Pr[= x | ...],[⊥ | ...]→Pr[= none | ...]. generateSeedreturnsProbComp, lifted vialiftComp.
Bundles the inputs to the forking lemma.
- main : OracleComp spec α
- queryBound : ι → ℕ
- js : List ι
Instances For
The forking operation: run main with a random seed, then re-run it with the seed modified
at the s-th query to oracle i (where s = cf x₁), checking that both runs agree on cf.
Returns none (failure) when:
cf x₁ = none(adversary did not choose a fork point)- the re-sampled oracle response equals the original (no useful fork)
cf x₂ ≠ cf x₁(the second run chose a different fork point)
Equations
Instances For
If fork succeeds (returns some), both runs agree on the fork index.
On fork support, first-projection success equals old pair-style success event.
Key bound of the forking lemma: the probability that both runs succeed with fork point s
is at least Pr[cf(main) = s]² - Pr[cf(main) = s] / |Range i|.
The standard forking-lemma precondition is itself a valid probability bound.
Main forking lemma: the failure probability is bounded by 1 - acc * (acc / q - 1/h).
Forking-lemma lower bound, packaged directly as the success-event probability.