Repository navigation
feat(Crypto, Interactive): efficient extractors and simulators - #1893
Conversation
…VZK (#643) Add `EfficientSpecialSoundness` and `EfficientSpecialHVZK` for indexed families of Sigma protocols: the exact property with the same named extractor or simulator, plus a `ComputableInPolyTime` word extractor or an `IsPPTOn` word simulator realizing it up to statistical distance `δ`. Schnorr over any `PrimeOrderGroupFamily` satisfies both, with error `1 / 2 ^ n` from `sampleExp`. Tests show that under the discrete-logarithm assumption the efficient notions rule out `sendWitnessSigma` and `trustMeSigma`, which satisfy the unbounded notions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
Add `Verifier.EfficientKnowledgeSound` and `Reduction.EfficientHVZK` for indexed families of plain-model reductions: the exact property with the same named extractor or simulator, plus a `ComputableInPolyTime` word extractor or an `IsPPTOn` word simulator realizing it up to `δ`. Tests: sending the witness is efficiently knowledge sound, and efficiently HVZK when the witness is the statement; for discrete logarithms, the verifier that accepts without interaction and the protocol that sends the witness satisfy the unbounded notions but, under the discrete-logarithm assumption, not the efficient ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
|
|
|
reviewer-codex-edemaine (non-author worker): reviewing 2944a32, including both efficiency layers, Schnorr certificates and strict-separation tests. Checking the strict-PPT statistical convention and source mapping; reusing the earlier unbounded-security review. |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine: APPROVE at 2944a32 (independent agent review).
Read the complete eight-file change and underlying protocol, CloseTo, PPT and group-family contracts. Both layers certify the same named algorithms uniformly on the declared encodings. The simulator implementation pays δ once; the interactive honest-transcript bound is ε+δ. Schnorr's word program handles arbitrary word inputs with a strict clock, and on valid encodings implements z·g−c·u with the existing approximate sampler. Extraction reuses Fermat inversion and the plain polynomial-time contract.
Checked Boneh–Shoup v0.6, printed pp.30, 773–774 and 840. This is the documented strict-PPT statistical variant of Def.19.5, including possible δ acceptance failure; it does not claim exact sampling, malicious-verifier ZK or rewinding knowledge extraction. No polynomial relation between arbitrary family encodings and a security parameter is implicit: bounds are in encoded input length. The discrete-log separations use a standard open assumption and explicit error thresholds, rather than asserting hardness of the concrete test group.
The positive and four negative tests exercise the intended distinctions. Independent small-prime arithmetic checks confirm extraction and 30 approximate-sampling bounds. The encoding-based DecidableEq is sound; reusing Interactive.Security for CloseTo introduces no cycle. A nonblocking placement suggestion is inline. No curated-abstract impact. Whitespace and the 3,152-module aggregate pass. Hosted Lean CI 41159834159, Guide, Comparator and title passed; no reviewer Lean build. Live head rechecked before posting.
| ⟨fun a => encNat a.val, encNat.injective.comp (ZMod.val_injective _)⟩ | ||
|
|
||
| /-- Equality of group elements, decided on their encodings. -/ | ||
| instance (d : F.Desc) : DecidableEq (F.Carrier d) := fun a b => |
There was a problem hiding this comment.
Nonblocking API placement: encodeEmbedding and this encoding-based equality instance are generic PrimeOrderGroupFamily facilities. A small lower encoding module would also serve CramerShoup/Scheme's existing explicit DecidableEq clients without importing SchnorrProtocol. The implementation itself is sound; no change needed to the verdict.
|
Non-author integration coordinator Landed at 04:01:00 UTC as Canonical source CI passed all six gates on synthetic checkout Public cache verified. Publication completed at 04:10:05.1920854 UTC. The revision map returns HTTP 200: 4,269 unique mappings, 192,118 bytes, SHA256 The proved model remains strict-PPT statistical realization: simulator error |
|
Non-blocking note from |
Change
This is the efficiency layer for extractors and simulators that Samuel asked for on #643 (design). It covers all four notions: Sigma
SpecialSoundness/SpecialHVZKand interactiveVerifier.KnowledgeSound/Reduction.HVZK. They accept unbounded extractors and simulators, so they say little on their own (#1856, #1864). This PR adds efficient variants that reuse the existing PPT contracts. It introduces no new efficiency notion.Definitions (
Complexity/Crypto/Protocols/SigmaProtocol/Efficient.lean). Efficiency is uniform over a familyP iindexed byi : I, normally a unary security parameter plus a system parameter (B–S Def. 2.9). Types may depend on the index, so the algorithms are certified on words through aSigmaProtocol.Encoding.EfficientSpecialSoundness P R enc encW extract: special soundness at every index, and oneComputableInPolyTimeword function computesextracton encodings (ExtractorRealizedBy).EfficientSpecialHVZK P R enc simulate δ: perfect special HVZK at every index, and oneIsPPTOnword program isδ i-close (Interactive.CloseTo) tosimulate i y con encoded(t, z), for every statement and challenge (SimulatorRealizedBy). The errorδis needed because a strict-PPT machine cannot sampleZMod qexactly. Boneh–Shoup's Def. 2.8 avoids the issue by allowing a negligible probability of overrunning the clock.δ-close to honest transcripts at every challenge (SimulatorRealizedBy.closeTo_transcript), and it accepts with probability at least1 - δ(SimulatorRealizedBy.one_sub_le_accepts, Def. 19.5 (i) relaxed).Interactive core (
Complexity/Computability/Interactive/Efficient.lean). Same pattern, over familiesR iof plain-model reductions with anInteractive.Encoding(index, statement, transcript):Verifier.EfficientKnowledgeSound V relIn relOut enc encOut encIn E ε: straight-line knowledge soundness at every index, and aComputableInPolyTimeword extractor (Interactive.ExtractorRealizedBy).Reduction.EfficientHVZK R rel enc Sim ε δ:ε-HVZK at every index, and anIsPPTOnword programδ-close toSimon encoded transcripts (Interactive.SimulatorRealizedBy).SimulatorRealizedBy.closeTo_run: the program isε + δ-close to honest encoded transcripts.Schnorr (
Complexity/Crypto/Computational/SchnorrProtocol.lean), over anyPrimeOrderGroupFamily, indexed by(n, d), with challenges inZMod q:efficientSpecialSoundness_schnorr: the extractor is computed with the existingextractNat.efficientSpecialHVZK_schnorr: the strict-PPT programschnorrSimulateWordusessampleExp, withδ (n, d) = 1 / 2 ^ n(advantage_bind_sampleExp_le).SchnorrIdentification.leanmakesextractNat_castpublic and adds a plaincomputableInPolyTime_extractNat, so the instance reuses them instead of re-proving them.Tests (
ComplexityTests/EfficientSimulators.lean):extractNatevaluated on concrete numbers, and the Schnorr-group simulator accepting with probability at least1 - 1/2^n.PrimeOrderGroupFamily.DiscreteLogonly. On the discrete-log relation with witnesses inZMod q, every statement has exactly one witness, so the following hold with unbounded algorithms:sendWitnessSigmais special HVZK,trustMeSigmais special sound,dlTrustMe(accepting without interaction) is knowledge sound with error 0, andsendWitnessDLis perfectly HVZK. Their efficient versions would solve discrete logarithms:not_efficientSpecialHVZK_sendWitness, for anyδ ≤ 1/2;not_efficientSpecialSoundness_trustMe;not_efficientKnowledgeSound_dlTrustMe, for any error below1;not_efficientHVZK_sendWitnessDL, forε + δ ≤ 1/2.Docstrings: the
SpecialSoundness/SpecialHVZKdocstrings changed in #1870, and theInteractive/Security.leanmodule,KnowledgeSoundandHVZKdocstrings, now point to the efficient variants. The MPC docstrings from #1870 already point toMPC.PolyTime.Source mapping, checked against
BonehShoup_0_6.pdf:c ← C. Here the typed simulator is perfect at each fixed challenge, which is stronger than (ii) (seeSpecialHVZK.conversation_eq). The strict-PPT program is onlyδ-close to it, so (i) holds with probability at least1 - δ.Existing notions considered.
IsPPTOnandComputableInPolyTimeare the certificates.GenerableZeroKnowledgeandAuxiliaryInputZeroKnowledge(malicious verifiers, word protocols) are a different notion, and they are unchanged.Interactive.CloseTois reused forδ. The upstreamdist/StatisticallyCloseneedFintype, and the outputs here are words.PolyTimeis the precedent for certifying simulators through word runners.CertifiedHVZKis the design adopted here, generalized to an indexI.Encodingis a plain bundle of embeddings, likePrimeOrderGroupFamily.encode.Limitations.
isPPTOn_rewind.closeTo_of_advantage_le, a bridge fromGame.advantagetoCloseTo, is private here. It could become public once statistical distance on arbitrary types is unified.Validation
scripts/check.sh --quickfell back to all six gates locally. All passed at 8fcbefb (Sigma layer). At the Interactive commit, the gates passed apart from one over-long test line; I fixed it before committing, andlake test --wfail --iofailpasses at 2944a32.check_hygiene.py --check-simp,check_changed_files.pyandcheck_tidy_surface.pypass.parallel_defs.pyreports no candidates. Independent review has not happened yet.AI assistance
Written by
worker-claude-e6cf7b0d-zk-efficiency(Claude Code, Claude Opus 5.5) forcoordinator-claude-e6cf7b0d: design, Lean code and proofs, and the source check against the Boneh–Shoup PDF.🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG