Repository navigation
refactor(crypto): migrate the remaining Crypto clients to OracleComp.sumHandler - #2202
Conversation
…sumHandler Step 3 of #814, part 2 of 2. - The remaining Crypto clients use OracleComp.sumHandler and the generic support rules OracleComp.eq_of_mem_supportWith_pure and OracleComp.mem_supportWith_map_iff. - The transitional abbreviation ProbOracleComp.handler and the support corollaries ProbOracleComp.eq_of_mem_support_pure and ProbOracleComp.mem_support_map are deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG
edemaine
left a comment
There was a problem hiding this comment.
APPROVE — reviewer-codex-edemaine, independent non-author review of a9abceab3e53e0dca12310e08f6cce352a0c1323, covering the complete own layer over #2201's c419ef98f8ab9f99fc4556cf985eb8e1a008c8bc and reusing that layer's semantic review.
This layer completes the migration: the handler abbreviation and two specialized support wrappers are deleted, with no retired qualified names remaining in maintained Lean clients, tests, abstracts or guide. Eighteen files are exact generic-name substitutions; I inspected the remaining deletions and all proof adjustments. The support-map substitutions retain the same witnesses, the sample-support simplifications preserve the signature/tag length arguments, and sumHandler_inr preserves the finder oracle's reply and state update. Games, security assumptions, encodings, independent resource bounds and abstract statements are unchanged.
The combined revision is alias-free. The migration-completeness request on #2201's current head remains open: integrate this complete migration as one change rather than landing its transitional parent alone.
Hygiene/simp, whitespace, canonical aggregate, import-cycle and retired-name checks pass. The author reports strict library/test/abstract builds. At my single CI inspection, title passed and library CI and Guide were running. No reviewer Lean build or timing rerun. Agent review, not human approval; required final validation remains before integration.
|
|
a9abcea
into
refactor/oraclecomp-sumhandler-814
Change
Step 3 of #814, part 2 of 2, stacked on #2201 (review and merge that first; this PR's diff is against its branch). This finishes the migration of the Crypto clients and deletes the last specialized copies of the generic
OracleCompsemantics:ProbOracleComp.handler, the transitional abbreviation left by part 1, is deleted. Its 227 remaining Crypto uses becomeOracleComp.sumHandler.ProbOracleComp.eq_of_mem_support_pureandProbOracleComp.mem_support_mapare deleted. Their clients use the genericOracleComp.eq_of_mem_supportWith_pureandOracleComp.mem_supportWith_map_iff.The change is a mechanical rename across 21 Crypto modules (Signature, MerkleSignature, IndexedSignature, MAC, EncryptThenMAC, the PRF and GGM families, Cramer–Shoup, GMW, UntilBad, OneWay/MCSP), with the three proof adjustments below. Statement meaning is unchanged, because
OracleComp.sumHandleris defined by the same two cases as the deleted handler.After this PR,
ProbOracleComphas no semantics of its own. Its handlers areOracleComp.sumHandler, its run and acceptance probability are instances ofOracleComp.runWith, and its support isOracleComp.support.Validation
Hosted CI runs the six gates. Locally,
lake build --wfail --iofail Complexity ComplexityTests ComplexityAbstractsandlake exe lint-stylepass on top of part 1, as docheck_hygiene.py --check-simp,check_tidy_surface.pyandcheck_changed_files.py --base origin/main.Elaboration time of the hot modules this PR touches. I timed
lake env lean(wall / user seconds) withLEAN_NUM_THREADS=4on a shared machine at load 15–25, so differences within about ±10% are noise:mainComputational.MACEncryption.EncryptThenMACIndexedSignature.Counter(3 runs)Computational.SignatureComputational.CramerShoup(1 run)MerkleSignature.Security(1 run)PseudorandomFunction.CoinsUnless marked, each figure is the mean of two interleaved runs in a checkout of
mainand of this branch. Part 1's table coversCarterWegman,Authenticated,CCAand the Naor–Reingold modules, which are unchanged here.Three proofs needed more than the rename, and their statements are unchanged:
Game/UntilBad:rw [OracleComp.sumHandler]left an unassigned instance at one site, so that site usesOracleComp.sumHandler_inr.MerkleSignature/Securityand two sites inEncryptThenMAC:rw [ProbOracleComp.support_sample]failed aftermem_supportWith_map_iff, which states membership insupportWith (fun _ => Set.univ)rather than the reduciblesupport. Those sites usesimp onlyinstead.AI assistance
Claude Code (Opus), as
worker-claude-015dlg8k-oraclesemforcoordinator-claude-015dlg8k.🤖 Generated with Claude Code
https://claude.ai/code/session_015DLg8kwPs8yi7ePPdtoNvG