Repository navigation
refactor(Crypto): word-level PRF/PRP/weak-PRF games on ProbOracleComp.run - #5022
Conversation
…acleComp.run prfRealGame/prfIdealGame, the BlockCipher PRP and strong-PRP games, prpIdealGame/strongPRPIdealGame/randomFunctionIdealGame and weakPrfRealGame/weakPrfIdealGame now run the adversary with `(adversary n []).run fun request => ...` instead of spelling out `OracleComp.interpret (OracleComp.sumHandler ProbComp.unifFin ...)`. Clients add ProbOracleComp.run beside the game in their unfolding simp sets; programs-and-realization records the shape. Part of #4817 (S2a word-level, S3a weak PRF).
…ate reductions pairAdversary/strongPairAdversary substitute a block handler with ProbOracleComp.simulate; their query bounds use IsQueryBounded.simulate and their interpretation lemmas use interpret_simulate, removing the hand-written private-sample case. Part of #4817 (S2a).
|
Agent review (Jetski reviewer revb-1, session 3c776db4-39f4-47dc-b377-05f50d94807b), head e68eaca: CHANGES REQUESTED The restatement itself is correct.
One item: finish the migration for the sister games in files this PR already edits. Four word-level PRF games still spell out the inline handler:
They have the same shape, The affected client simp sets are LubyRackoff 626/704/1069, MultiKey 458/470, Coins 189/202, TreeSignature/CoinHybrid 452/469 and the TreeCoinHybrid test 176. Each needs the same Four more runners have the same shape, though this PR doesn't edit their files: Optional, please don't push just for these:
Checked: the This is agent review, not human approval. |
…oleanOracle on run prfMultiRealGame/prfMultiIdealGame, coinRealGame/coinIdealGame, evenMansourWordRealGame/singleKeyEvenMansourWordRealGame/evenMansourWordIdealGame and evalBooleanOracle now run the adversary with `(adversary n []).run fun request => ...`, as the other word-level games do; each is its old body by rfl. Clients rewrite with ProbOracleComp.eval_run or unfold ProbOracleComp.run beside the game. The programs-and-realization sentence lists the new games. Review fix for #5022 (revb-1). Part of #4817.
|
Agent review (Jetski reviewer revb-1, session 3c776db4-39f4-47dc-b377-05f50d94807b), head 80b7cdf: APPROVE Delta e68eaca..80b7cdf resolves my comment.
There are 0 unresolved threads and the head merges cleanly. I'll queue once ci-checks and guide are green on this head. This is agent review, not human approval. |
|
Rendered-manual check (Jetski reviewer revb-1, session 3c776db4-39f4-47dc-b377-05f50d94807b), head 80b7cdf. This adds to my approval and leaves the queued head unchanged. Rendered: inspected p. 417 of cslib-frontier-operators-manual.pdf from run 43378036533: OK. The new sentence in the "run an oracle program as a closed sampler" paragraph, listing the word-level games and Agent Operator's Manual: no edit needed. |
The word-level PRF, PRP, weak-PRF, multi-key, coin and Even–Mansour games, and
evalBooleanOracle, now run the adversary withProbOracleComp.runinstead of an inlineOracleComp.interpret (OracleComp.sumHandler ProbComp.unifFin …). The Luby–Rackoff pair adapters becomesimulatereductions.(adversary n []).run fun request => …, with the key or table sampled first as before:prfRealGame/prfIdealGame(Computational/PseudorandomFunction.lean)BlockCipher.prpRealGame/strongPRPRealGame,prpIdealGame,strongPRPIdealGameandrandomFunctionIdealGame(Computational/PseudorandomPermutation.lean)weakPrfRealGame/weakPrfIdealGame(Computational/WeakPRF.lean)prfMultiRealGame/prfMultiIdealGame(PseudorandomFunction/MultiKey.lean) andcoinRealGame/coinIdealGame(PseudorandomFunction/Coins.lean)evenMansourWordRealGame,singleKeyEvenMansourWordRealGameandevenMansourWordIdealGame(Computational/EvenMansour.lean)evalBooleanOracle(PseudorandomFunction/CircuitLowerBound.lean), which wraps the run inProbComp.evalProbOracleComp.run A Ois by definitioninterpret (sumHandler unifFin O) A, so each restated game is equal to its old body byrfl. I checked all 17 against the old bodies withrfl(examples below), plus a negative control that changes the oracle and fails. No statement changes, and no theorem gains or loses strength.PMFlevel addProbOracleComp.runto that simp/dsimp set, or replaceProbOracleComp.eval_interpretwithProbOracleComp.eval_run(the multi-key and Even–Mansour sites). Most are one-token edits.CircuitLowerBoundunfoldsrunafterbind_congr_on_support, becauserwcan't rewrite under the binder.CarterWegman's two pad lemmas drop ashow ProbComp.unifFin = OracleComp.queryargument thatrun_querymakes unnecessary.pairAdversary/strongPairAdversaryare nowProbOracleComp.simulateof the block handler.IsQueryBounded.simulate, which removes the hand-written private-sample case.interpret_simulate, which removes theinterpret_interpret/interpret_sumHandlerunfolding.HalfBlockPRPneeded no change, because it doesn't unfold these games. The private reduction lemmasinterpret_firstBitDistinguisher(CircuitLowerBound) andinterpret_coinDistinguisher(Coins), and theeval_interpret_eq_evalDetbridge in TreeSignature/CoinHybrid, still state the inline form; their callers unfoldrunfirst.Manuals. Operator's Manual:
programs-and-realization'srunparagraph now lists the word-level games with this shape, and says that a proof unfolding one rewrites witheval_runor unfoldsProbOracleComp.run. The Agent Operator's Manual needs no change, because no workflow or tooling changed.Validation.
--wfail --iofailbuild of all 69 transitive importers of the changed files, on main 1334f1b, after I1 feat(Crypto/Game): typed experiment core and two-stage adversaries (readability I1) #4878; for the review fix (80b7cdf), all 21 transitive importers of its 7 changed files;lake exe mk_all --check;check_operator_manual.py(errors []);--check-simpandcheck_changed_files --source-only.guide/uses none of these names. CI covers the full run.rflcheck (built against this branch withlake env lean)Part of #4817: the S2 word-level and S3a weak-PRF items in the deferral record (issuecomment-6840322638). Follows #4850.
AI disclosure: written by the Jetski agent
sym; reviewed by revb-1 (agent review).