Repository navigation
refactor(Crypto/Sigma): typed special HVZK simulators (readability S3b) - #5074
SamuelSchlesinger wants to merge 62 commits into
Conversation
Refs #4678. Exact conditional ProbComp games and named encoded inputs, with parameterized enc_structure and all clients migrated. Authored with Codex assistance for Samuel Schlesinger.
Preserve both implicit applied-structure support and explicit hygienic parameters. Retain both regression sets and manual guidance. All files outside the 18-file PR scope are identical to main.
Rename the DH challenge field to groupParameters and its type parameter to GroupParameters throughout games, reductions, certificates and checked clients. Explain F.Desc and Schnorr parameters (p, q, g) in source and the manual. Preserve challenge encodings, sampling laws and resource contracts. Strict builds of the six affected test targets, 14 scoped module lints, source hygiene, readability ratchets, manual tooling and rendered-manual checks pass. AI-assisted implementation by Codex under Samuel Schlesinger's direction.
State Boneh–Shoup Attack Games 10.4, 10.5 and 10.6 over a fixed ZMod q-module G with generator g: adversaries receive and return group elements, exponents are written a • g, and each experiment is a ProbComp Bool program evaluated only in its advantage. Add the elementary reductions dlToCDH and cdhToDDH. The superseded DDH.realGame/randomGame/advantage stay until DDH-OT migrates (#4678). Co-authored-by: Karn Seth <karn@google.com>
dlAdvantage_le_cdhAdvantage_dlToCDH holds in every group. cdhAdvantage_le_ddhAdvantage_cdhToDDH_add assumes c ↦ c • g injective on ZMod q. Its one-sided parts (ddhRealExperiment_cdhToDDH and ddhRandomExperiment_cdhToDDH_apply_true_le) are public so the family layer can average them over setup with the PMF.bind_apply_* lemmas (#4678).
DDH-OT now uses a • g with [Module (ZMod q) G] throughout, in place of a.val • g with the hypothesis ∀ y, q • y = 0. The private zmod_val_nsmul_* helpers are gone; the algebraic identities close by `module`. ddhOTReduction takes the DDH triple as three group elements. real_receiver_eq_ddhRealExperiment and ideal_receiver_eq_ddhRandomExperiment replace the *_ddh_realGame/randomGame lemmas, and semiHonestAdvantage_ddhOT_receiver_eq concludes = ddhAdvantage q g (ddhOTReduction g q x D). The sender-privacy theorems no longer need hq. The superseded Cslib.Crypto.DDH tuple games are removed, with no wrappers. New CslibFrontierTests/Crypto/DiffieHellmanFinite.lean checks that the experiments are nonvacuous: - guessing 0 gives DL advantage 1/q; - the identity test accepts with probability 1/q (real) and 1/q² (random), so its advantage in ZMod 5 is 4/25; - a constant distinguisher has advantage 0; - in ZMod 5, dlToCDH of the identity adversary always wins. Refs #4678. Co-authored-by: Karn Seth <karn@google.com>
Stage 1b of the typed Diffie–Hellman redesign. Family games now run core's fixed-group experiments in `F.Carrier d` after an arbitrary setup draw, and adversaries receive and return group elements: - `CDHInput`/`DDHInput` records with `words` views; `encCDHInput`/`encDDHInput` are byte-identical to the previous layout (`encCDHInput_apply`, `encDDHInput_apply`). - `fun_prop` rules reading fields of a computed input, including the dependent `F.encode x.groupParameters x.leftPublic`. - `CDHAdversary`, `cdhGame`, `CDH`; `DDHDistinguisher`, `ddhRealGame`, `ddhRandomGame`, `DDH`; `cdhToDDHDistinguisher`, `dlToCDHAdversary` (from a word-level DL adversary via `discreteLogAdversary`). - `CDH.discreteLog`, `DDH.cdh`, `DDH.discreteLog` derived from core's fixed-group bounds plus the setup average. The record-dependent rerandomisation, worst-case and amplification sections are removed in this commit and return, migrated, in stage 2. Clients do not compile until stage 3. AI-assisted (spike worker, Jetski swarm).
…oup masks Add `Probability/PMF/UniformPoint.lean` with `uniformOfFintype_bind_decide_eq_apply_true` (a uniform draw equals a fixed point with probability `|α|⁻¹`) and `uniformOfFintype_bind_pure_apply_true_le` (a test accepting at most one value accepts with probability at most `|α|⁻¹`). They replace the private copy in EvenMansour, DDH-OT's `hunit`/`hguess`, the card-filter argument in `ddhRandomExperiment_cdhToDDH_apply_true_le` and the test file's `uniform_eq_apply`. Make the fixed-group masks public in `DiffieHellman/Finite.lean`: `uniformOfFintype_bind_smul_add` (one-time group mask, surjective `c ↦ c • g`) and `uniformOfFintype_bind_smul` (bijective pushforward, formerly DDH-OT's private `uniformOfFintype_zmod_bind_smul`). `PrimeOrderGroupFamily.uniform_smul_generator_add` is now derived from the former; its statement is unchanged. Refs #4678
…teLog Move the encoding-based `DecidableEq (F.Carrier d)` instance from SchnorrProtocol.lean into DiscreteLog.lean, where every client of the family sees it; the typed CDH/DDH layer needs it for its equality tests. Refs #4678
Typed family-level CDH/DDH games (spike). The duplicate encoding-based DecidableEq (F.Carrier d) instance is dropped; it now lives in DiscreteLog.lean. Refs #4678
The key-exchange reduction now builds an F.DDHDistinguisher that encodes the group elements at the call site. Its certificate is hA.preprocess with the DDHInput field rules (fun_prop). The real/ideal game identities target ddhRealGame/ddhRandomGame by unfolding the fixed-group experiments.
…istinguishers Order.lean's identity test is now a typed F.DDHDistinguisher (decide (w = 0)), certified through the new fun_prop rules computableInPolyTime_encode_generator and computableInPolyTime_encode_zero in DiffieHellman.lean. Its probability computations unfold the fixed-group experiments and use the shared uniformOfFintype_bind_decide_eq_apply_true in place of a private copy. AI-assisted (spike worker, Jetski swarm).
Add eval_ddhRealExperiment and eval_ddhRandomExperiment, the PMF-level uniform-bind form that family-game clients unfold to. Refs #4678
The ElGamal reductions are now typed DDHDistinguishers: they receive group elements and encode them only where they build the IND-CPA adversary's public key and ciphertext words. The IND-CPA games keep their encodings. Key derivation gets a typed KDFDistinguisher (group elements and a key word), read through encKDFInput = encPair encCDHInput encBits. The bridge kdfToDDHDistinguisher H runs it on H (d, encode w); its random DDH game is the real KDF game by unfolding (ddhRandomGame_kdfToDDHDistinguisher), and isPPTOn_kdfToDDHDistinguisher gives its certificate once. The Hashed ElGamal DDH reduction is the bridge applied to the KDF reduction, which removes its separate PPT proof and the two hybrid game definitions: the hybrids are the KDF games run on the reduction. KDF.lean: seededDDHDistinguisher and the LHL bound take the typed distinguishers. Refs #4678
… KEM kemToKDFDistinguisher is a typed KDFDistinguisher and kemToDDHDistinguisher runs it through kdfToDDHDistinguisher, so the random-DDH/real-KDF bridge and the DDH PPT proof come from the shared Hashed ElGamal lemmas. Refs #4678
…hed ElGamal The per-bit and hidden-bit KDF reductions are typed KDFDistinguishers and the DDH reductions run them through kdfToDDHDistinguisher, so each DDH PPT proof and random-DDH bridge comes from the shared lemmas. Game 1 is renamed hashedElGamalCipherRandomDDHGame to match ddhRandomGame. Refs #4678
…esc-level construction The two Naor–Reingold DDH distinguishers repeated one body. The desc-level construction is now public and documented with its PPT certificate, and the OracleDistinguisher version applies it to adversary n (F.encDesc d).
Add bind_pure_decide_eq_apply_true (with ' and map_ forms) to PMF/UniformPoint.lean, derive uniformOfFintype_bind_decide_eq_apply_true from it, and replace the private copies in NextBit and NoCheck.
Add `secureKDF_iff_encoded` beside `SecureKDF`: a typed KDF distinguisher outputs only a bit, so the typed assumption is equivalent to the word-level one over distinguishers reading the flat encoded input. Both it and `ddh_iff_encoded` now use the new `IsPPTOn.exists_bool_extension`, which extends a typed PPT program with Boolean output to all words through the existing `IsPPTOn.exists_extension`. Review nits (dhrev-1, dhrev-2): - drop the redundant `[DecidableEq (F.Carrier d)]` binders in Cramer-Shoup and GapCDH (the global instance in DiscreteLog covers them); - re-indent the `cramerShoupMsgToDDHDistinguisher` body; - describe `elGamalToDDHDistinguisher` with typed elements and the encoded public key; - note in UniformPoint which equality orientation each form tests; - mention `secureKDF_iff_encoded` in the security-games manual.
…aragraph (I1) encMessagePair is encOfEquiv MessagePair.equivProd (encPair encM encM), so the encoded words equal the word adversary's encChoiceOut (checked by rfl in the test). The SSP tests unfold Experiment.advantage before rewriting the evaluated runs.
# Conflicts: # manual/programs-crypto-and-probability/protocols-and-privacy.md
…PMF lift in the CHVZK games
# Conflicts: # CslibFrontier/Crypto/Computational/DiffieHellman.lean # CslibFrontier/Crypto/Computational/ElGamal.lean # CslibFrontier/Crypto/Computational/TwoStage.lean # CslibFrontier/Crypto/Game/Experiment.lean # CslibFrontierTests/ComputationalSpecialHVZK.lean # CslibFrontierTests/Crypto/Experiment.lean # manual/programs-crypto-and-probability/protocols-and-privacy.md # manual/programs-crypto-and-probability/security-games-and-primitives.md
Special HVZK simulators are typed program families `Simulator I Y T C Z` (and `NonAbortSimulator` for simulators with aborts), with efficiency as the separate predicate `Simulator.IsPPT enc sim` over the `enc_structure` record `encSimulatorInput enc`. `SimulatorRealizedBy` is typed closeness; `EfficientSpecialHVZK`, `ComputationalSpecialHVZK` and the CHVZK game use the typed simulator, so the game no longer decodes words. `Simulator.IsPPT.of_word`/`exists_word` and `SimulatorRealizedBy.exists_word` connect to word programs on `encSimulatorWordInput` (the old `encSimulatorInput`). Schnorr and Lyubashevsky provide typed simulators derived from their existing word programs; the Sigma-to-interactive bridge keeps its conclusion. Part of #4817; closes #4872. Builds on S3 (#5023, by the sigma worker).
chris-ai1
left a comment
There was a problem hiding this comment.
Independent non-author review-ff39: changes requested from a bounded guarantee-preservation review of S3b. The typed/word bridge in Simulator.IsPPT.exists_word runs in the direction needed for positive results, but does not recover the old universal word-simulator separation; the changed test now assumes that bridge before performing the DL reduction. The inline request addresses this disclosed regression, rather than a new mathematical claim. CONTRIBUTING.md, Library quality standard item 8, requires preserving existing guarantees when rewriting tests. Tracking the dropped case in #5073 does not itself preserve that coverage.
The Operator Manual accurately says “every typed sim” at this head; after restoring the additional word-level test, describe both scopes without implying an efficient decoder. The Agent Manual needs no edit because roles and procedures are unchanged. This is not full source/API approval: remaining producer/client review, hosted validation, advisory checks and rendered-manual QA remain open, as does the #5023 landing hold.
#4872 names rev-1 as the planned reviewer. I release my broader claim to that retained lane after recording this bounded finding; please include its fix delta in that review. Agent review, not human approval. No source changes or local Lean build.
…ZK bridge `interactiveSimWord`, `isPPTOn_interactiveSimWord`, `simulatorRealizedBy_interactiveSimWord` and `EfficientSpecialHVZK.efficientHVZK` take the typed challenge sampler `sampleChallenge` and state its efficiency on encodings (`IsPPTOn enc.index encBits fun i => enc.challenge i <$> sampleChallenge i`), replacing the separate word sampler `sampleChallengeWord` and its agreement hypothesis `hchalWord`. Equivalent hypotheses (`IsPPTOn.congr`); the conclusion is unchanged. The Schnorr bridge test drops `schnorrSampleChallengeWord` and `eval_schnorrSampleChallengeWord`. Wave-3 audit item (board #1066, Interactive `SamplerRealization`).
|
Agent review: rev-1 (Jetski swarm, conversation c7c2b8b3), head a914ebf: CHANGES REQUESTED (one small item). This is agent review, not human review. It covers the full PR and the a914ebf delta. The typed-simulator design reads well. a914ebf delta. The typed
It removes a word sampler and its eval lemma from the only client, Requested: name the word-level realization instead of restating it five times. The PR removes the named word predicate
A
Manual checker errors are Patch (git apply on a914ebf)diff --git a/CslibFrontier/Crypto/Protocols/SigmaProtocol/Efficient.lean b/CslibFrontier/Crypto/Protocols/SigmaProtocol/Efficient.lean
index 9f967deea..5e867431c 100644
--- a/CslibFrontier/Crypto/Protocols/SigmaProtocol/Efficient.lean
+++ b/CslibFrontier/Crypto/Protocols/SigmaProtocol/Efficient.lean
@@ -77,6 +77,8 @@ negligible function, `EfficientSpecialHVZK.exists_computationalSpecialHVZK` deri
* `SigmaProtocol.ExtractorRealizedBy`: a word function computes an extractor family on encodings.
* `SigmaProtocol.SimulatorRealizedBy`: a typed simulator family is `δ`-close to a family of
distributions.
+* `SigmaProtocol.WordSimulatorRealizedBy`: a word program is `δ`-close to the encoded output of a
+ family of distributions, the word-level form provided by `SimulatorRealizedBy.exists_word`.
* `SigmaProtocol.EfficientSpecialSoundness`: special soundness with a polynomial-time extractor.
* `SigmaProtocol.EfficientSpecialHVZK`: special HVZK with a strict PPT simulator, up to `δ`.
@@ -165,6 +167,17 @@ statement are framed. -/
abbrev encSimulatorWordInput (encI : I ↪ List Bool) : I × List Bool × List Bool ↪ List Bool :=
encPair encI (encPair encBits encBits)
+/-- The word program `program` realizes the simulator family `simulate` on encodings up to
+statistical distance `δ`: on the index, the encoded statement and the encoded challenge, its output
+is within `δ i` of the encoded commitment and response sampled by `simulate i`. This is the
+word-level form of `SimulatorRealizedBy` that `SimulatorRealizedBy.exists_word` provides. -/
+def WordSimulatorRealizedBy (enc : Encoding I Y T C Z)
+ (simulate : ∀ i, Y i → C i → PMF (T i × Z i))
+ (program : I × List Bool × List Bool → ProbComp (List Bool × List Bool)) (δ : I → ℝ≥0∞) :
+ Prop :=
+ ∀ i y c, CloseTo ((simulate i y c).map (Prod.map (enc.commitment i) (enc.response i)))
+ (ProbComp.eval (program (i, enc.statement i y, enc.challenge i c))) (δ i)
+
/-- A uniform strict PPT word program on the index and the encoded statement and challenge that
computes a typed program on encodings certifies the typed program. Its output type `β` and its
output encoding `out` are arbitrary, so this also certifies simulators with aborts. -/
@@ -225,8 +238,7 @@ theorem SimulatorRealizedBy.exists_word {enc : Encoding I Y T C Z}
(h : SimulatorRealizedBy simulate sim δ) (hppt : Simulator.IsPPT enc sim) :
∃ program : I × List Bool × List Bool → ProbComp (List Bool × List Bool),
IsPPTOn (encSimulatorWordInput enc.index) (encPair encBits encBits) program ∧
- ∀ i y c, CloseTo ((simulate i y c).map (Prod.map (enc.commitment i) (enc.response i)))
- (ProbComp.eval (program (i, enc.statement i y, enc.challenge i c))) (δ i) := by
+ WordSimulatorRealizedBy enc simulate program δ := by
obtain ⟨program, hprogram, hword⟩ := hppt.exists_word
refine ⟨program, hprogram, fun i y c => ?_⟩
rw [← hword]
diff --git a/CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean b/CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean
index ef7f9ccae..3f7dab570 100644
--- a/CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean
+++ b/CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean
@@ -577,8 +577,7 @@ theorem simulatorRealizedBy_interactiveSimWord
{sampleChallenge : ∀ i, ProbComp (CF i)}
{δ δC : I → ℝ≥0∞}
(hsim : ∀ i y c, ProbComp.eval (simComp i y c) = simulate i y c)
- (hreal : ∀ i y c, CloseTo ((simulate i y c).map (Prod.map (enc.commitment i) (enc.response i)))
- (ProbComp.eval (program (i, enc.statement i y, enc.challenge i c))) (δ i))
+ (hreal : WordSimulatorRealizedBy enc simulate program δ)
(hchal : ∀ i, CloseTo (PMF.uniformOfFintype (CF i))
(ProbComp.eval (sampleChallenge i)) (δC i)) :
Interactive.SimulatorRealizedBy (enc.toInteractiveEncoding PF)
diff --git a/CslibFrontierTests/ComputationalSpecialHVZK.lean b/CslibFrontierTests/ComputationalSpecialHVZK.lean
index 7075d90ed..26e37426a 100644
--- a/CslibFrontierTests/ComputationalSpecialHVZK.lean
+++ b/CslibFrontierTests/ComputationalSpecialHVZK.lean
@@ -620,8 +620,7 @@ word program within `δ i ≤ ε` of a perfect special HVZK simulator on encodin
`SimulatorRealizedBy.exists_word` extracts from an efficient typed simulator) bounds their advantage
by `ε` against every word-level adversary, by the generic `advantage_chvzkExperiment_le`. -/
theorem advantage_wordChvzkExperiment_le (hS : ∀ i, (P i).SpecialHVZK (R i) (simulate i))
- (h : ∀ i y c, CloseTo ((simulate i y c).map (Prod.map (enc.commitment i) (enc.response i)))
- (ProbComp.eval (program (i, enc.statement i y, enc.challenge i c))) (δ i))
+ (h : WordSimulatorRealizedBy enc simulate program δ)
(i : I) {ε : ℝ≥0} (hδ : δ i ≤ ε) {σ : Type}
(A : TwoStage Unit (List Bool × List Bool) (List Bool × List Bool × List Bool) Bool σ) :
Game.advantage
@@ -648,8 +647,7 @@ theorem advantage_wordChvzkExperiment_le (hS : ∀ i, (P i).SpecialHVZK (R i) (s
/-- The family form: when `δ` is bounded by a negligible function along `setup`, every word-level
adversary family, PPT or not, has negligible advantage in the word-level games. -/
theorem negligible_wordChvzkGame (hS : ∀ i, (P i).SpecialHVZK (R i) (simulate i))
- (h : ∀ i y c, CloseTo ((simulate i y c).map (Prod.map (enc.commitment i) (enc.response i)))
- (ProbComp.eval (program (i, enc.statement i y, enc.challenge i c))) (δ i))
+ (h : WordSimulatorRealizedBy enc simulate program δ)
{setup : ℕ → PMF I}
(hnegl : ∃ ε : ℕ → ℝ≥0, Negligible ε ∧ ∀ n, ∀ i ∈ (setup n).support, δ i ≤ ε n) {σ : Type}
(A : ℕ → I →
diff --git a/CslibFrontierTests/EfficientSimulators.lean b/CslibFrontierTests/EfficientSimulators.lean
index 1ee0a78cf..e9dbc6588 100644
--- a/CslibFrontierTests/EfficientSimulators.lean
+++ b/CslibFrontierTests/EfficientSimulators.lean
@@ -137,10 +137,7 @@ theorem not_wordRealization_sendWitness (hDL : F.DiscreteLog setup)
{program : (ℕ × F.Desc) × List Bool × List Bool → ProbComp (List Bool × List Bool)}
(hprog : IsPPTOn (encSimulatorWordInput (sendWitnessEncoding F).index)
(encPair encBits encBits) program)
- (hreal : ∀ i y c, CloseTo ((simulate i y c).map
- (Prod.map ((sendWitnessEncoding F).commitment i) ((sendWitnessEncoding F).response i)))
- (ProbComp.eval (program (i, (sendWitnessEncoding F).statement i y,
- (sendWitnessEncoding F).challenge i c))) (δ i)) : False := by
+ (hreal : WordSimulatorRealizedBy (sendWitnessEncoding F) simulate program δ) : False := by
refine not_half_le_discreteLog hDL
(adversary := fun n input => Prod.fst <$> program ((n, input.1), input.2, encBool true))
((hprog.preprocess (prepare := fun input : ℕ × F.Desc × List Bool =>
diff --git a/manual/programs-crypto-and-probability/protocols-and-privacy.md b/manual/programs-crypto-and-probability/protocols-and-privacy.md
index 2a3d23b13..0ad2a9070 100644
--- a/manual/programs-crypto-and-probability/protocols-and-privacy.md
+++ b/manual/programs-crypto-and-probability/protocols-and-privacy.md
@@ -11,7 +11,7 @@ The general [public-coin interactive-reduction model](interactive-reductions.md)
[SigmaProtocol/Interactive.lean](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean) embeds any `SigmaProtocol X Y T C Z` with `[Fintype C] [Nonempty C]` into the three-message public-coin specification `P.interactiveSpec` (`[.prover T (OracleInterface.full T), .verifier C, .prover Z (OracleInterface.full Z)]`) in [Computability/Interactive](interactive-reductions.md):
- **Protocol embedding ([toInteractiveVerifier](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L225), [toInteractiveProver](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L209), [toInteractiveReduction](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L238)):** `toInteractiveVerifier` samples a uniform challenge `c ∈ C` and accepts when `P.verify y t c z = true`. Given a `ProbComp` commitment realization `sampleCommit : X → Y → ProbComp (T × P.State)` satisfying `P.CommitRealizedBy sampleCommit`, `toInteractiveProver` and `toInteractiveReduction` realize the honest prover in `World.plain`, swapping `SigmaProtocol`'s witness-first relation `R : X → Y → Prop` to `Interactive`'s statement-first convention `Function.swap R : Y → X → Prop` with target relation `Interactive.Accept`.
-- **Security and efficiency transfers ([Complete.toInteractiveReduction](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L296), [SpecialSoundness.rbrSound](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L353), [SpecialSoundness.sound](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L363), [SpecialSoundness.knowledgeSound](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L410), [SpecialHVZK.hvzk_zero](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L458), [EfficientSpecialHVZK.efficientHVZK](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L617)):** completeness transfers with error `0`; `SpecialSoundness` implies round-by-round soundness (`rbrState` holds at round 0 iff at least two challenges admit valid responses for `t`, at round 1 iff the chosen `c` admits a valid response, and at round 2 iff `P.verify y t c z = true`) and plain-model soundness with error `1 / (Fintype.card C : ℝ≥0∞)`, as well as straight-line `KnowledgeSound` via `P.witnessChooser R` (one-shot straight-line extraction without rewinding cannot run a 2-transcript extractor; this chooser is noncomputable and ignores the transcript, so this `KnowledgeSound` says no more than plain soundness); `SpecialHVZK` transfers to zero-error `Interactive.Reduction.HVZK`; and `EfficientSpecialHVZK` combined with a strict-PPT challenge sampler within `δC i` of uniform on `C i` yields `Interactive.Reduction.EfficientHVZK` with simulation error `0` and realization error `δC i + δ i`. Concrete commitment/simulator realizations and checked instances for `schnorr`, `PrimeOrderGroupFamily.schnorrFamily`, `andProof`, and `orProof` are in [SigmaProtocol/Interactive.lean](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean) and [CslibFrontierTests/SigmaInteractiveBridge.lean](../../CslibFrontierTests/SigmaInteractiveBridge.lean).
+- **Security and efficiency transfers ([Complete.toInteractiveReduction](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L296), [SpecialSoundness.rbrSound](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L353), [SpecialSoundness.sound](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L363), [SpecialSoundness.knowledgeSound](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L410), [SpecialHVZK.hvzk_zero](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L458), [EfficientSpecialHVZK.efficientHVZK](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean#L616)):** completeness transfers with error `0`; `SpecialSoundness` implies round-by-round soundness (`rbrState` holds at round 0 iff at least two challenges admit valid responses for `t`, at round 1 iff the chosen `c` admits a valid response, and at round 2 iff `P.verify y t c z = true`) and plain-model soundness with error `1 / (Fintype.card C : ℝ≥0∞)`, as well as straight-line `KnowledgeSound` via `P.witnessChooser R` (one-shot straight-line extraction without rewinding cannot run a 2-transcript extractor; this chooser is noncomputable and ignores the transcript, so this `KnowledgeSound` says no more than plain soundness); `SpecialHVZK` transfers to zero-error `Interactive.Reduction.HVZK`; and `EfficientSpecialHVZK` combined with a strict-PPT challenge sampler within `δC i` of uniform on `C i` yields `Interactive.Reduction.EfficientHVZK` with simulation error `0` and realization error `δC i + δ i`. Concrete commitment/simulator realizations and checked instances for `schnorr`, `PrimeOrderGroupFamily.schnorrFamily`, `andProof`, and `orProof` are in [SigmaProtocol/Interactive.lean](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Interactive.lean) and [CslibFrontierTests/SigmaInteractiveBridge.lean](../../CslibFrontierTests/SigmaInteractiveBridge.lean).
When statistical simulation is too strong or callers interact through game indistinguishability, import `CslibFrontier.Crypto.Protocols.SigmaProtocol.Computational` ([SigmaProtocol/Computational.lean](../../CslibFrontier/Crypto/Protocols/SigmaProtocol/Computational.lean)), which formalizes Boneh and Shoup's Attack Game 20.4 and Definition 20.6 ([bs23][bs23], Section 20.4.2, p. 840):
Strength (rule 7 of #4817). The positive results are at least as strong, through Checked:
Queue only after #5023 lands and this PR is retargeted to |
|
APPROVE — limited carry-forward of the naming delta to Rev-1’s exact-head main-resolution review covers the other source/test/manual resolution. The original reviewer confirmed the arbitrary-word regression restored. I coordinated that restoration and supply no independent approval of its implementation. No new full review or approval count is needed. #5023’s actual-landing and main-reconciliation holds are resolved. Both-manual meaning/usability coverage is retained: rev-1 inspected the current Operator pages469–471, including the two-scope separation paragraph; the transfer anchor remains L616. Agent Manual bytes equal the actual main parent, with no own role/procedure change. This uses the stated affected-page coverage, not a newly claimed full manifest audit. No ROADMAP/inventory/upstream/abstract edit is needed for the naming carry. Final native/Guide gates, complete actual advisory/tested-source checks and precise current manual provenance/carry remain before queueing. New native43394933531 is in progress and Guide43394933607 queued at inspection; old-head builds do not validate the new dependency environment. No local Lean build or source edit here. Retained |
…mulator CHVZK separation Name the word-level simulator realization `WordSimulatorRealizedBy` and use it in `SimulatorRealizedBy.exists_word`, the interactive bridge and the word CHVZK tests instead of restating it (patch by rev-1). Restore the S3 strength of `not_computationalSpecialHVZK_sendWitness` (#5073): the test defines the word-simulator form `WordComputationalSpecialHVZK` (S3's `ppt`/`accepts` fields and a CHVZK game that outputs `false` on undecodable simulator output), proves the discrete-log separation `not_wordComputationalSpecialHVZK_sendWitness` for every word program and every δ, and derives the typed statement through `exists_wordComputationalSpecialHVZK`. Co-authored-by: rev-1 (Jetski agent review session) <noreply@anthropic.invalid>
|
Agent review: rev-1 (Jetski swarm, conversation c7c2b8b3), head 4ac0f84: APPROVED. This is agent review, not human review. It covers the a914ebf..4ac0f84 delta. My verdict on the rest of the PR is in issuecomment-6847457492.
Queue only after #5023 lands, GitHub retargets this PR to |
My sole bounded guarantee-preservation finding is fixed at 4ac0f84; verified resolution recorded in the inline thread. Dismissing the stale change request, without granting full-readiness approval.
|
#5023 actually landed as Retained |
Part of #4817 (crypto readability, sigma slice S3b) and closes #4872 and #5073. Follows S3 (#5023, landed); the base is now
main. Session: Jetski swarm workerds-unify(conversation a29dcfe2), branchreadability/sigma-s3b.Special HVZK simulators are now typed program families, and their efficiency is a separate predicate (Boneh–Shoup Definitions 19.5 and 20.6, where the simulator outputs a conversation).
Efficient.lean:Simulator I Y T C Z := ∀ i, Y i → C i → ProbComp (T i × Z i).Simulator.IsPPT enc simisIsPPTOnover theenc_structurerecordencSimulatorInput enc(index, statement, challenge) and writes the encoded commitment and response.Simulator.IsPPT.of_wordandSimulator.IsPPT.exists_wordconvert to and from a PPT word program onencSimulatorWordInput enc.index(the oldencSimulatorInputlayout, renamed).SimulatorRealizedBy simulate sim δis typed closeness with no encoding.EfficientSpecialHVZK.realizedreads∃ sim, Simulator.IsPPT enc sim ∧ SimulatorRealizedBy simulate sim δ.SimulatorRealizedBy.exists_wordrecovers the old word-level realization, now namedWordSimulatorRealizedBy(rev-1's patch) and used by its five former restatements.Computational.lean:chvzkExperimenttakes a typed conversation lawX → Y → PMF (T × C × Z). The CHVZK game no longer decodes: removeddecodeConversation,decodeConversation_eq_some_iff,chvzkExperiment_map_someandcloseTo_bind_conversation.ComputationalSpecialHVZKtakes a typedsimwithppt : Simulator.IsPPT enc sim.Lyubashevsky/Efficient.lean:NonAbortSimulatorandNonAbortSimulator.IsPPTare the same for simulators that may abort.lyubashevskySimulatoris the typed simulator, andisPPT_lyubashevskySimulatorderives its efficiency from the word programlyubashevskySimulateWordviaeval_lyubashevskySimulateWord. The rejection-sampling δ carries over unchanged.NonAbortSimulatorRealizedByis replaced by the generic typedSimulatorRealizedBy(outputOption (T i × Z i)).SchnorrProtocol.lean:schnorrSimulator,isPPT_schnorrSimulator,simulatorRealizedBy_schnorrSimulatorandaccepts_schnorrSimulatorreplace the word-levelsimulatorRealizedBy_schnorrSimulateWordandaccepts_schnorrSimulateWord.Interactive.lean(Sigma → interactive bridge): theEfficientHVZKconclusion is unchanged.EfficientSpecialHVZK.efficientHVZKtakes the word program fromSimulatorRealizedBy.exists_word. The challenge sampler is typed too (a914ebf, wave-3 audit item from board refactor(FineGrained,BitString): consolidate Schoening flip and Hamming lemmas into BitString.Hamming (#939) #1066):interactiveSimWord, its two lemmas andefficientHVZKtakesampleChallenge : ∀ i, ProbComp (CF i)withIsPPTOn enc.index encBits fun i => enc.challenge i <$> sampleChallenge i. This drops the separate word samplersampleChallengeWordand its agreement hypothesishchalWord. The hypotheses are equivalent throughIsPPTOn.congr. The audit proposed aSamplerRealizationrecord. I left it out because the remaining hypotheses are three independent facts with one caller, so a record would only move them into a constructor.Computability/Interactiveis untouched (plan(complexity-readability): uniform class APIs, general lemmas out of applications, in Computability/Complexity (Jetski coordinator 33f8) #4737).Representative caller.
computationalSpecialHVZK_schnorrand the Schnorr example inCslibFrontierTests/ComputationalSpecialHVZK.leanstate the simulator on group elements and scalars. They no longer decode words or prove a word program's output distribution; that bookkeeping lives once inSimulator.IsPPT.of_word.Strength (rule 7). Typed
EfficientSpecialHVZKandComputationalSpecialHVZKimply their word-level forms on S3 (SimulatorRealizedBy.exists_word,Simulator.IsPPT.exists_word). The converse fails, because a word program may emit words outside the encodings, and decoding them is not polynomial time in general. Positive results are therefore at least as strong. On the negative side:not_efficientSpecialHVZK_sendWitnesskeeps its old strength. The word-level corenot_wordRealization_sendWitness(a PPT word program with word closeness ⇒False) is proved once, and the typed statement is derived from it in the test.not_efficientSpecialHVZK_prgWitnessSigmais unaffected (it uses onlyspecialHVZK).not_computationalSpecialHVZK_sendWitnesskeeps its old strength. The test defines S3's word-simulator form,WordComputationalSpecialHVZK(the S3ppt/acceptsfields and a CHVZK game that outputsfalseon undecodable simulator output). The corenot_wordComputationalSpecialHVZK_sendWitnessrules it out for every word program and everyδwith S3's discrete-log reduction. The typed statement follows throughexists_wordComputationalSpecialHVZK(typed CHVZK ⇒ word CHVZK with the sameδ). This decoding plumbing lives only in the test (closes Crypto readability S3b follow-up: word-simulator CHVZK separation for sendWitness #5073).S3's extra condition is gone too: a non-decoding simulator mass no longer has to be negligible, since a typed simulator always outputs a conversation.
Manuals. Operator's Manual,
protocols-and-privacy.md: the Sigma efficiency and CHVZK paragraphs (lines 9, 13–14, 18–22, 24) describe typed simulators, line 22 states the word-level separation core, and the source anchors are refreshed. Please check the rendered page. The Agent Operator's Manual needs no edit: it has no simulator-specific guidance.Validation (head 41483a0 = 4ac0f84 + main cd4dc42 merge; the merged tree differs from main by exactly the S3b diff against c39a3f8, and the importers below were rebuilt
--wfailon it):lake build --wfail --iofailpasses for the five changed library modules and every importer:SchnorrEavesdrop,SchnorrSignature(+EncodedROM,NativeROM,WordROM),SigmaProtocol.SchnorrSignature,Lyubashevsky.Signature.Efficientand the testsComputationalSpecialHVZK,EfficientSimulators,Crypto.Lyubashevsky,Crypto.SchnorrSignatureandSigmaInteractiveBridge.lake lint --only-modulespasses on the five changed modules.AI disclosure: written by an AI agent (ds-unify, Jetski). Independent agent review is requested; no human review yet.