Enhanced UC DSL (v2) #
Extended notation and proof combinators for the UC factorization framework, eliminating boilerplate in UC proofs.
Component A: Protocol definition helpers #
UCProtocol.ofGame— wrap a game into UC protocol (the.inrboilerplate)UCSpec.ofGame— standard UC spec for game-to-game reductions
Component B: One-shot UC proof combinators #
UCEmulates_of_isPure_advantage— computational UC from IsPure + advantage boundUCEmulates_of_game_eq— perfect UC from program equalityUCEmulates_of_game_sdist— sdist at game level implies UC
Component C: Game-hop chaining #
sdist_game_hop₂— 2-step game hopsdist_game_hop₃— 3-step game hop
Component D: Mixed Trans instances #
Component E: Algebraic UC combinators #
UCEmulatesAlgcomposition tracking simulatorsTransinstance for algebraic calc-style proofs
Component A: Protocol Definition Helpers #
Wrap a game into UC protocol form.
Eliminates the repetitive .inr wrapping pattern found in every *_UC.lean file.
The game output goes through the .inr (leak/adversary) channel, while the
honest output channel .inl carries Unit.
Equations
- CatCrypt.Crypto.UCDSL.UCProtocol.ofGame G x = (G x).bind fun (o : leak) => CatCrypt.Core.SPComp.pure (Sum.inr o)
Instances For
Standard UC specification for game-to-game reductions.
When reducing game G_real to G_ideal with the same leak type,
the UC spec has out = Unit and leak = sim_if.
Equations
- CatCrypt.Crypto.UCDSL.UCSpec.ofGame hon leak V = { hon := hon, out := Unit, leak := leak, sim_if := leak, view := V }
Instances For
Component B: One-Shot UC Proof Combinators #
Computational UC emulation from IsPure + advantage bound.
This is the most common pattern in UC proofs:
- Both games are IsPure (built from sample/pure)
- The advantage is bounded by ε
- sdist_isPure_le reduces sdist to advantage
- sdist_comp_right handles the .inr wrapping
- UCEmulates_of_sdist gives UC security
Before (PRF_UC.lean, ~25 lines of IsPure proofs + sdist helper + UC theorem):
theorem prf_uc_secure ... := by
apply UCEmulates_of_sdist
exact le_trans (sdist_comp_right _ _ _) (prf_sdist F ε hAdv)
After (single application):
exact UCEmulates_of_isPure_advantage hPure_r hPure_i hAdv
Perfect UC emulation from program equality.
When the real and ideal games are extensionally equal, UC emulation holds with ε = 0. This covers the OTP pattern.
Before (OTP_UC.lean):
apply UCEmulates_of_sdist
rw [otpReal_eq_otpIdeal]
exact le_of_eq (sdist_self _)
After:
exact UCEmulates_of_game_eq otpReal_eq_otpIdeal
UC emulation from sdist bound at the game level.
When sdist G_real G_ideal ≤ ε, UC emulation holds.
The .inr wrapping is handled automatically via sdist_comp_right.
Variant of UCEmulates_of_isPure_advantage using AdvantageA.
Takes advantage bounds in the form AdvantageA (G_real x) (G_ideal x) D ≤ ε
that appears directly in most security definitions.
Component C: Game-Hop Chaining #
3-step game hop (covers CascadePRF_UC pattern).
If sdist Gᵢ Gᵢ₊₁ ≤ εᵢ for i = 0, 1, 2, then
sdist G₀ G₃ ≤ ε₁ + ε₂ + ε₃.
4-step game hop (covers Cryptobox compositional decomposition).
If sdist Gᵢ Gᵢ₊₁ ≤ εᵢ for i = 0, 1, 2, 3, then
sdist G₀ G₄ ≤ ε₁ + ε₂ + ε₃ + ε₄.
UC emulation via 2-step game hop.
Chains two game hops at the UC level.
Component E: Algebraic UC Combinators #
Notation for algebraic UC emulation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Composition of algebraic UC emulations tracking simulators.
If π₁ ⟶ₐ[ε₁, Sim₁] π₂ and π₂ ⟶ₐ[ε₂, Sim₂] π₃,
then π₁ ⟶ₐ[ε₁ + ε₂, Sim₂ ∘ Sim₁] π₃.
Algebraic UC from sdist with identity simulator.
Trans instance for algebraic UC calc-style proofs.
Equations
- CatCrypt.Crypto.UCDSL.ucEmulatesAlg_trans_inst = { trans := ⋯ }
Utility: ofGame distributes over function application #
UCSpec.ofGame expands to the expected anonymous constructor.