Repository navigation
Conversation
Co-Authored-By: Codex <noreply@openai.com>
…roof Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
…ity bound Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
🤖 PR SummaryMathematical Formalization: One-Time Pad and ElGamal SecurityThis PR adds the One-Time Pad (complete worked example)
ElGamal IND-CPA Security ReductionThe main mathematical contribution is a modular proof that the one-time ElGamal advantage is bounded by
Core Security Statement (Bound.lean, lines ~133)wordGame_advantage_le (adversary : WordAdversary) :
|wordGame adversary - 1/2| ≤ 2 * AdvDDH adversary.distinguisher + 4 / 2^nBoth a bit-message result for strict-PPT adversaries and a word-message result guarded by a validity check are provided. Adversary Implementation Example
Protocols / Soundness
Infrastructure / CI
Documentation
Refactoring
Notes
Statistics
Lean Declarations ✏️ Added: 142 declaration(s)
📋 **Additional Analysis**Findings This is a large, structured pull request that adds the optional 1. File Headers and Attribution
No violations found. 2. Documentation Expectations (Module Docstrings, Declaration Docstrings, Prologue Layout)New files in
Existing files modified:
Suggestion: Add a brief docstring to 3. Module Scopes / Section Headers /
|
Changes and package layout
This PR adds
VCVioFrontier, an optional Lake package that connects VCVio security proofs to cslib-frontier’s probabilistic Turing machines. It proves perfect secrecy for a one-time pad machine and a concrete one-time IND-CPA bound for an implemented ElGamal scheme. This advances #906.Interop/use the same core PolyFun revision on Lean 4.36.0. Building on the return-predicate migration in chore(deps): pin PolyFun's inductive return predicate and retire the support workaround #1204, the one-time IND-CPA game now exposes its two fixed-challenge branches, and the ElGamal reduction factors out the choice, coin draw, and guess shared by its typed and encoded versions.VCVioFrontier/imports VCVio by path and addsPolyFunFrontierandcslib-frontieron Lean 4.36.0-rc2. Within it,OracleComp/relates program and machine output laws,CryptoFoundations/relates the security definitions, andExamples/applies both.VCVioFrontierTest/contains runnable examples. The package has its own manifest and CI build. Package configurationVerified-zkEVM/PolyFun#510 supplies the scoped-term theory. Verified-zkEVM/PolyFun#511 adds the machine interpretation and is pinned here at
01547e78. The pin can move to the merged revision once both land. Stable lint and tests passed atc23778f1. The axiom sweeps checked 32,435 stable and 156 Frontier declarations and found no uses ofsorryor nonstandard axioms. Clean Linux build of the nested packageHow the definitions fit together
From an interface to a machine. A polynomial functor describes the available requests and the response type of each request. A VCVio
OracleCompis a tree of those requests in CSLib’sPFunctor.FreeM. PolyFun handlers give the requests meaning.PPTProgram.substitutelets a request be implemented by another free program and uses handler composition to carry its polynomial-time proof through the substitution. For local computations,wordTerm_polyTimelifts bounds for primitive word operations to whole scoped terms. @SamuelSchlesingerpolytimetactic from cslib-frontier supplies the primitive bounds. Handler substitution · Scoped terms and TM automationFrom machine output to a VCVio game. Given a
PPTProgramproof for a handlerHand fixed bit encodings,MachineRealization.ofPPTProgramchooses one fair-coin multi-tape machine and a polynomial clock bounding every supported run. VCVio’s finite-choiceProbCompis definitionally equal toCslib.ProbComp. The theoremevalDist_eq_toMeasureproves their evaluations agree. Together they giveoutput_measure, which identifies the output of that same machine on the word encoding ofawith VCVio’s measure of the handled program.For Boolean games,
boolDist_toMeasure_eq_advantageidentifies the two distinguishing advantages.negligible_coe_iffthen transfers negligibility of finite advantages, sosecureAgainst_iff_indistinguishablepreserves the choice of admissible adversaries. Probability semantics · Machine output · Security definitionsGuide to the examples
One-time pad
encryptWord. It requests one Boolean per message bit and XORs the answers with the message. With thetapeBitshandler, message010and tape1001yield ciphertext110and leave1on the tape. InstallfairBitson the same tree to obtain the randomized encryption experiment. Run the examplekey xor msgandkey xor (key xor msg)to the encryption and round-trip machines.encryptMachine_uniformtransports VCVio’s uniform-ciphertext theorem to machine output.encryptMachine_rowsgives identical output laws for any two equal-width messages, androundTripMachine_correctrecovers the message using the same key. Machine theoremsElGamal
wordScheme_efficientproves uniform polynomial time for key generation, encryption, and decryption when the group description is computable in polynomial time from the unary security parameter. Honest programs · Installed algorithmsAdversaryRealizationconnects VCVio’s typed adversary to two polynomial-time word procedures. The choice stage preserves the joint law of both messages and the saved state, accounting for the two games’ message order. The guess stage agrees on the encoded state and ciphertext.R.machine_output_openOraclethen identifies the clocked machine’s output law with the encoded result of VCVio’s original reduction. Run the choose-and-guess example · Frontier DDH distinguisher · Machine correspondenceR.implemented_advantage_lein VCVio’s one-time IND-CPA game. At parametern, the advantage is at most2 · AdvDDH + 4 / 2^nfor this adversary’s own DDH distinguisher. The factor of two comes from the exact-exponent reduction. The bounded sampler contributes at most2 / 2^nfor each challenge bit. Uniform machine DDH for the prime-order family with the specified group description at each parameter gives negligible advantage for every word adversary realizing a typed adversary. Companion results cover strict-PPT bit-message adversaries and word messages checked by a polynomial-time guard that accepts only valid encodings. Pointwise bound and DDH corollary · Bit and guarded games