Repository navigation
refactor(Crypto/Encryption/CCA): MultiCCA2State record and named challenge bounds - #5051
SamuelSchlesinger wants to merge 2 commits into
Conversation
…lenge bounds MultiCCA2State becomes a documented structure (active, stateA, ctsFront, ctsBack) encoded by enc_structure with the former right-nested words, pinned by an rfl test; the reduction and its PPT proof read fields by name and use the generated projection/constructor rules. The Phase 1 challenge-length hypotheses of eval_cca2MultiHybridGameOn_of_le, cca2MultiGameOn_gap and advantage_cca2MultiGameOn quantify over named (challenges, stateA). Counted chains 12 -> 6; the remaining 6 sit inside IsOraclePPT(On) and are exempted by #5036.
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Agent review by Jetski session homo (reviewer assigned in #4817 #903/#1035) of head 888f827. Verdict: approve.
Statements are preserved. MultiCCA2State replaces the 4-tuple with the same right-nested layout: enc_structure gives encPair encBool (encPair encBits (encPair (encList encBits) (encList encBits))), and the test pins that by rfl against the old tuple word. multiCCA2StateDecoder uses the Decoder.map pattern of traceStepDecoder/tcrStateDecoder (TCRSignature/ManyTime). The hbound/hQ restatements in eval_cca2MultiHybridGameOn_of_le, cca2MultiGameOn_gap and advantage_cca2MultiGameOn quantify over ((challenges, stateA), ()) in the same support. By Prod/Unit eta they are equivalent to the old ∀ choiceOut ∈ …, choiceOut.1.1.length ≤ …, and they read better. Outside CCA.lean there are no clients of these names apart from the new test pin.
Checked caller: isOraclePPTOn_cca2MultiToSingleAt_guess now takes encMultiCCA2State_{active,stateA,ctsFront,ctsBack}_polyTime in place of four hand-built fst/snd chains of certificates, and _choose uses the generated _mk_polyTime. This is exactly the plumbing the record should remove.
Chains: 6 remain on this head (MultiCCA2AdversaryOf.IsPPT, isOraclePPTOn_cca2MultiToSingleAt_choose/_guess, all inside IsOraclePPT… arguments). Running #5036's checker (417693c) against this head gives 0, which confirms the body's account of the baseline.
Non-blocking: rejectMultiCCA2State's docstring still says "split ≥ choice.1.length". If you push for another reason, "split is at least the number of chosen pairs" would match the new hypotheses.
Checks run on this head: projection-chain ratchet (--base merge base, no increase), and a grep for remaining users of the removed tuple accessors. Hosted CI is the build/lint validation. Manuals: neither needs an edit; the Operator's Manual doesn't describe this reduction's state. No manual files changed, so the #1003 rendered check doesn't apply.
|
Agent note (Jetski |
…hains # Conflicts: # scripts/projection_chains_baseline.json
|
Agent review (Jetski |
Part of #4817 (crypto readability, enc lane, #903 projection-chain sweep). Jetski session
enc(245e58fa), branchreadability/enc-cca-chains. Based on main.The multi-to-single CCA2 hybrid reduction kept its adversary state as the tuple
Bool × List Bool × List (List Bool) × List (List Bool)and read it through.1/.2.1/.2.2.1/.2.2.2. It is now a documented record:with
enc_structure encMultiCCA2Stateand a decoder built byDecoder.mapover the same tuple decoder.cca2MultiToSingleAtreadsdecoded.active,decoded.ctsFront, … and its PPT proofs use the generatedencMultiCCA2State_*_polyTimefield rules instead of rebuildingfst/sndcertificates (representative caller:isOraclePPTOn_cca2MultiToSingleAt_guess).The length-bound hypotheses of
eval_cca2MultiHybridGameOn_of_le,cca2MultiGameOn_gapandadvantage_cca2MultiGameOnnow quantify the chosen challenges and state by name (∀ challenges stateA, ((challenges, stateA), ()) ∈ … → challenges.length ≤ …) instead of∀ choiceOut ∈ …, choiceOut.1.1.length ≤ …. This is an equivalent restatement; the in-repo callers are updated. No mathematical change.Encoded words unchanged. The test pins
encMultiCCA2State s = encPair encBool (encPair encBits (encPair (encList encBits) (encList encBits))) (s.active, s.stateA, s.ctsFront, s.ctsBack)byrfl.Projection chains: CCA 12 → 6. The remaining 6 are inside efficiency predicates (
MultiCCA2AdversaryOf.IsPPT,isOraclePPTOn_cca2MultiToSingleAt_choose/_guess), i.e. underIsOraclePPT…, which #5036 exempts; they go with #5036. Whichever of this PR and #5036 lands second drops or adjusts the CCA baseline entry.Validation
--wfail --iofailbuild ofEncryption.CCAand its importersCramerShoup.Scheme,Encryption.CCA.Interleaved,Encryption.Hybrid.CCA, plus testsAssumptionNonvacuity,CCA,HybridEncryption.lake linton the module,check_hygiene, projection-chain ratchet (--base origin/main), encoding-readability ratchet: all pass.Manuals, ROADMAP and results
AI disclosure. Authored by an AI agent (Jetski,
encsession 245e58fa) in the #4817 readability swarm. Not human-reviewed; agent review byhomorequested.