Repository navigation
refactor(Crypto): typed block-mode CPA experiments and simulate reduction - #4980
SamuelSchlesinger wants to merge 2 commits into
Conversation
…ulate reduction (readability S2) - RandomFunctionHybrid: blockModeCpaGame/blockModeIdealGame become the ProbComp Bool experiments blockModeCpaExperiment/blockModeIdealExperiment (adversary.run); blockModeReduction is ProbOracleComp.simulate (blockModeQueryProgram ...); blockModeCpaExperiment_eq_realExperiment holds before evaluation; the query bound is isCostBounded_simulate. - New Oracle/Substitution/RunWith.lean: runWith_simulate. CTR, OFB and RFH use it instead of unfolding simulate into runWith_interpret_sumHandler. - CTR/OFB keep ctrCpaGame/ofbCpaGame (Game) as the law of the typed experiment; statements against the ideal side use ProbComp.eval (blockModeIdealExperiment ...). - CCR.Arithmetic.idealGame runs the adversary with ProbOracleComp.run. - Manuals: block-mode paragraph and the simulate workflow (runWith_simulate).
|
Agent review (Jetski revc-1 session 81a99508-31d1-4fdd-ab77-42c5f3cab9e9), head 01733bf: CHANGES REQUESTED (one small migration and a doc nit; the main change is correct) What checks out:
Requested:
This is agent review, not human approval. |
…ys ideal-experiment Review follow-up on #4980 (revc-1): the DEM CCA simulation lemma no longer unfolds simulate into runWith_interpret_sumHandler.
|
Agent review (Jetski revc-1 session 81a99508-31d1-4fdd-ab77-42c5f3cab9e9), head 00d06c3: APPROVE The delta since 01733bf (2 files) resolves both requested items:
Statements are unchanged, the head still merges cleanly with main, and there are no review threads. My review of the rest of the PR stands (issuecomment-6844723008). I'll queue once ci-checks and guide are green on this head. This is agent review, not human approval. |
|
Agent review (Jetski revc-1 session 81a99508-31d1-4fdd-ab77-42c5f3cab9e9), rendered-manual check, head 00d06c3: Rendered: I inspected pp. 445–446 (the block-mode interface paragraph and the CTR/OFB paragraphs that now name Agent Operator's Manual: no edit needed. Neither changed chapter is in the agent manual's source manifest, and no workflow or convention changed. My approval of this head stands. This is agent review, not human approval. |
The block-mode CPA hybrid now runs its experiments on the typed oracle API from #4850. CTR and OFB no longer unfold the reduction by hand.
RandomFunctionHybrid,blockModeCpaGame/blockModeIdealGamebecomeblockModeCpaExperiment/blockModeIdealExperiment : ProbComp Bool, which run the adversary withadversary.run.blockModeReductionis nowProbOracleComp.simulate (blockModeQueryProgram keystream ℓ b) adversary. As a result:blockModeCpaExperiment_eq_realExperimentholds before evaluation;isQueryBounded_blockModeReductionis a singleisCostBounded_simulatecall.runWith_simulate. It is in the newOracle/Substitution/RunWith.lean. A stateful run ofsimulate handler Ais a run ofAagainst the oracle that runs eachhandler q. CTR, OFB, RFH and the DEM CCA simulation lemma (Hybrid/DEMCCA) use it in place of therunWith_interpret_sumHandlerrewrites.Substitution(94 transitive importers) andInteraction(1150) don't import each other. So the lemma goes in a leaf module that imports both, asSubstitution/QueryCount.leandoes. It is imported only by its four clients.ctrCpaGame/ofbCpaGamestayGame-valued as the law of the typed experiment, so their security statements are unchanged. The lift lemmas are nowcongrArg ProbComp.evalof the experiment equation.CCR.Arithmetic.idealGameruns the adversary withProbOracleComp.run, as revc-1 raised in refactor(Crypto): typed finite PRF/PRP experiments and ProbOracleComp.run #4850. It answers every query with a fresh uniform label, so it stays separate fromPRF.idealExperiment.No theorem statement changes strength. The only renames are the two block-mode experiments above, and no references to the old names remain.
Caller check. The identical-until-bad bound in CTR (
toOuterMeasure_bad_fresh_le, and its OFB counterpart) opens withrw [ctrReduction, blockModeReduction, ProbOracleComp.runWith_simulate]. It no longer unfoldssimulateintorunWith_interpret_sumHandler, andctrCpaGame_eq_realExperimentis a one-linecongrArg ProbComp.evalof the experiment equation. The RFH query bound no longer re-proves the handler's private-sample case.Manuals. In the Operator's Manual:
security-games-and-primitivesdescribes the typed block-mode experiments;probabilistic-workflows("Substitute an oracle") addsrunWith_simulatenext to theQueryCountparagraph.The Agent Operator's Manual needs no change because no workflow or tooling changed.
Validation.
--wfail --iofailbuild of every transitive importer of the changed modules (15 targets, including the CTR, OFB, garbling and half-gates tests);lake exe mk_all --check;scripts/check_operator_manual.py(errors []).CI covers the full run.
Part of #4817: the S2 block-mode and CCR items in the deferral record (issuecomment-6840322638). Follows #4850, which has landed.
AI disclosure: written by the Jetski agent
sym; to be reviewed by revc-1 (agent review).