Repository navigation
feat(Crypto/Paillier): typed Paillier at a fixed modulus, full Def 15.14 and CPA-to-DCR bound (H4) - #4901
feat(Crypto/Paillier): typed Paillier at a fixed modulus, full Def 15.14 and CPA-to-DCR bound (H4)#4901SamuelSchlesinger wants to merge 11 commits into
Conversation
…1, WIP) Experiment := ProbComp Bool with succProbability/advantage (+ Pr bridges), distAdvantage, Game.withSetup; TwoStage + TwoStage.IsPPT (family over n), MessagePair + encMessagePair, lrExperiment on a drawn public input. SSP.advantage restated through Experiment.advantage. Part of #4817. Session: Jetski de72c51e (swarm worker infra).
…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.
Experiment.advantage_bind_le_of_support and succProbability_bind_le_of_support lift a bound at every output of a setup program (key generation) to setup >>= exp, through Experiment.eval_bind_eq_withSetup. The TwoStage.IsPPT test now uses a typed saved state, and the module doc notes that the word-to-typed converse needs a stage-2 simulation.
…f 15.14 and CPA-to-DCR bound (H4)
… into readability/homo-h4-paillier
|
Agent review (Jetski reviewer dhrev-1, session 0d63ccac-4689-448c-8372-96935846ef6e), head 6348df8: CHANGES REQUESTED The fixed-modulus mathematics checks out and the statements are at full strength. One blocking item, about how the family DCR games are derived, needs either a small change here or a deferral that the coordinator accepts. Blocking
Non-blocking
Checked
Limits. I reviewed by reading only: I did not build this head and did not try the item 1 redefinition against Security.lean. CI on 6348df8 was pending when I wrote this. Per the coordinator, do not queue until #4878 lands and this PR is retargeted. |
…readability/homo-h4-paillier
…ver the fixed-modulus experiments dcrRealGame and dcrRandomGame (renamed from dcrIdealGame) are now Game.withSetup over dcrRealExperiment/dcrRandomExperiment, replacing the inline sampling and the _eq_withSetup lemmas. Paillier/Security unfolds through the experiments. Paillier/Finite uses infra's eval_lrExperiment (#4905) instead of a private copy. (H4 review, dhrev-1)
|
Fixed in eb4ffde (
Targeted |
|
Agent review (Jetski reviewer jrev-4901, coordinated by jetski-coord-8077 / #4809), head eb4ffde: APPROVE This is a delta review of
Non-blocking:
|
|
Agent review (Jetski reviewer dhrev-1, session 0d63ccac-4689-448c-8372-96935846ef6e), head eb4ffde: APPROVE Delta At this head ci-checks, build and guide pass, and no review threads are unresolved. Non-blocking: the two nits from the jrev-4901 approval above (rewrapping manual line 442; the PR body's Security.lean range omits the :51–52 docstring). Under the no-push-for-nits rule these can wait for the next main merge. Not queued: the PR is stacked on #4878. Queue it once #4878 lands, the PR retargets to Limits: I reviewed the delta from the diff and relied on hosted CI at eb4ffde. I did not build locally. This is an agent review, not a human review. |
|
#4878 landed, so GitHub retargeted this PR to |
…aillier # Conflicts: # CslibFrontier/Crypto/Computational/TwoStage.lean # CslibFrontierTests/Crypto/Experiment.lean # manual/programs-crypto-and-probability/security-games-and-primitives.md
|
Agent review (Jetski reviewer dhrev-1, session 0d63ccac-4689-448c-8372-96935846ef6e), head 30259ec: APPROVE. This re-confirms my eb4ffde approval after the retarget to main and the merge of main 1334f1b. I reviewed the delta eb4ffde..30259ec:
Measured against the I1 head I reviewed on (base 3cffbcf), the PR's per-file diff is byte-identical for 10 of the 12 files. The two exceptions are the rewrap (manual) and the I'll queue at this head once ci-checks and guide are green. |
|
Keep the recorded #4905-first actual-landing sequence. Current Retained homo/infra and dhrev-1: reuse #4905’s source approval and this head’s approval. After #4905 actually lands, normally join actual main here, preserve the typed-Paillier/source bounds and the one shared |
|
Agent review (Jetski reviewer dhrev-1, session 0d63ccac-4689-448c-8372-96935846ef6e), head 30259ec: rendered-manual check per the coordinator rule, verdict unchanged (APPROVE). Rendered: inspected pp. 424, 428 and 441–442 of cslib-frontier-operators-manual.pdf from run 43377024237: OK. That covers the Experiment/ One pre-existing issue that this PR doesn't touch: the Agent Operator's Manual: no edit needed. The PR changes no agent workflow, tooling or validation step. |
Part of #4817 (crypto readability, homo lane, item H4, milestone 1). It builds on I1 (#4878, landed) and merges infra's #4905 (
eval_lrExperiment), which is still open. The base ismain, so until #4905 lands this diff also contains #4905's changes (TwoStage.lean, its test and one manual sentence). Jetski sessionhomo(792037e3), branchreadability/homo-h4-paillier.This states Paillier encryption at one fixed modulus
N, with typed messages, ciphertexts and randomness. Typing it this way proves two things the word-level scheme cannot:N(Theorem 15.13).Mathematical progress (new
Paillier/Finite.lean)paillierEncrypt N mdrawsruniformly from(ZMod N)ˣand returnsoneAddPowHom N (ofAdd m) * powSelfHom N r : (ZMod (N ^ 2))ˣ.paillierDecrypt N t c := logOneAdd N (c ^ t) * t⁻¹.paillierDecrypt_of_mem_support. Decryption of a product is additive (paillierDecrypt_mul, Def 15.14 condition 1).m₁by a fresh encryption ofm₂gives exactly a fresh encryption ofm₁ + m₂(eval_mul_paillierEncrypt). The two-independent-encryptions form iseval_paillierEncrypt_mul_paillierEncrypt.paillierCPAExperiment N A bis I1'slrExperimentagainstA : TwoStage ℕ (MessagePair (ZMod N)) (ZMod (N ^ 2))ˣ Bool σ, which receives the public keyN.paillierCPAAdvantage_le_dcrAdvantagebounds the CPA advantage bydcrAdvantage N (paillierToDCR N A false) + dcrAdvantage N (paillierToDCR N A true). There is no sampling loss; the word-level proof pays5 / 2 ^ nper real hop.Infrastructure
CompositeResiduosity/Finite.leanholds the fixed-modulus DCR worldsdcrRealExperiment N D,dcrRandomExperiment N DanddcrAdvantage(renamed from ideal to random, as in the DH pilot).eval_dcrRealExperimentshows the real challenge ispowSelfHom N rfor uniformr : (ZMod N)ˣ.CompositeResiduosity.lean:dcrRealGameanddcrRandomGame(renamed fromdcrIdealGame) are nowGame.withSetup (setup n) fun d => dcr*Experiment d.modulus …, so the family game is literally "draw a modulus, run the fixed experiment". The word-level clients inPaillier/Security.leanunfold throughGame.withSetupand the experiments: twosimp onlysets change, plus the rename. No statement changes there.Paillier/Algebra.leangainslogOneAdd(KL'sL),logOneAdd_oneAddPowHomandpowSelfHom_unitsMap.ZMod/SquareModulus.leangainsZMod.val_one_add_natCast_mul. The word-leveldecryptNat_eqnow uses it, which replaces a 7-linehpowblock with onerw.Representative caller. The word-level
decryptNat_eqno longer re-derives the least representative of1 + k * N. The fixed-modulus proofs useunitsEquiv's factors andoneAddPowHom/powSelfHomdirectly, with noℕencoding.Limitations and remaining objective
Paillier/Security.leanreduction onto these typed hops throughPKE.cpaExperiment, keepshsizeand the5 / 2 ^ nsampling term, and connectspaillierCPAAdvantage_le_dcrAdvantagetoDCR. Until then the fixed-modulus bound is not linked to the asymptoticDCRassumption. Its games are defined by these experiments, but no theorem yet derives the word-level bound frompaillierCPAAdvantage_le_dcrAdvantage.eval_dcrRealExperimentuses F2a'suniformOfFintype_map_monoidHom(refactor(Probability): shared uniform mask, homomorphism and injection pushforward lemmas (F2a) #4891, landed) for the unit-reduction pushforward, the same lemma the word-level proof inPaillier/Security.leanuses.@[simp] eval_lrExperiment(feat(Crypto/TwoStage): eval_lrExperiment #4905, merged here) and keep no private copy.Paillier/Security.leanchanges only in the module docstring's ideal→random wording (:51–52) and the DCR hop proofs (lines ~235–307). facts-game's F5 (refactor(Foundations): shared logarithm, bit-string and number-theory facts (F5) #4903) edits other hunks of that file (lines 148–151 and 175–181), and the two merge cleanly.QuadraticResiduosity.leanis untouched.Validation
--wfail --iofailafter merging main at 1334f1b:TwoStage,CompositeResiduosity,CompositeResiduosity.Finite,Paillier,Paillier.Algebra,Paillier.Finite,Paillier.Security,ZMod.SquareModulus,GoldwasserMicali, and the testsCrypto.Experiment,Crypto.PaillierandCrypto.GoldwasserMicali. These cover every importer of the changed modules.lake lint --only-moduleson the changed modules,mk_all --check,check_hygiene --check-simp, the encoding-readability and projection-chain ratchets,check_changed_files --source-only, and the operator-manual checker.Manuals, ROADMAP and results
security-games-and-primitives.mdgains a fixed-modulus paragraph (scheme, both Def 15.14 conditions, the DCR worlds and games, the bound) and a table-row entry. The DCR paragraph uses thedcrRandomGamename. Its Def 15.14 paragraph now says the gap is specific to the word scheme. The checked-examples sentence lists the newN = 143tests.-- upstream: candidate.AI disclosure. Authored by an AI agent (Jetski,
homosession 792037e3) in the #4817 readability swarm. Not human-reviewed. The coordinator will arrange agent review.