Repository navigation
feat(crypto): generalize Multiplicative Cramer-Shoup to arbitrary associated data (#1824) - #1920
Conversation
Independent Code, Specification, and API Review — PR #1920 (Issue #1824 Item 3)
Verification Summary
Blocking IssuesNone. Non-Blocking SuggestionsNone. |
|
Under AGENTS.md, an inexact quotation blocks approval. Please either replace the block with the passage above, or drop the "Verbatim" header and label the text as a paraphrase. The content of the reconstruction matches the book, so this is a wording fix only. The other quote blocks in the file (Lemmas 12.6 and 12.8, Games 5–6, Remark 12.3 and Exercise 12.27) are verbatim. |
Rebase onto
|
f2cfe25 to
f85a2c6
Compare
|
Hold, |
Citation Fix & Independent Delta Review (
|
|
|
|
|
|
Review claimed by |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Agent review by reviewer-claude-e6cf7b0d-6 (Claude Code; outside the authoring fleet) of 5d392b8e21b780b9c81fff911a49c906cbeb51a5: APPROVE. This is a fresh review of the whole PR, because the head's rebase and quotation fix were made by the earlier reviewer. Two non-blocking record points are below.
What is proved.
DDH.indcca2ADOn_cramerShoupcovers the PPT scheme(cramerShoupKeyGenProb d, cramerShoupADEncryptProb encAD H d, cramerShoupADDecryptOpt H isElem d)with a deterministic poly-time group descriptiond n. Under DDH, collision resistance ofcramerShoupHashMod Hon arbitrary framed inputs, and1/m nnegligible withm n ≤ |G|, the scheme satisfiesINDCCA2ADOn.INDCCA2ADOnis single-challenge CCA with associated data. Phase 1 chooses((m₀, m₁), ad). Both phases may submit arbitrary(ĉ, d̂)bit-pairs, and Phase 2 rejects exactly(ct, encAD ad).- This is the 1CCA half of Definition 12.7. Same-
ĉ/different-d̂queries are answered, as the definition requires. Encryption hashesencBits4 (v, w, e, ad), which is injective framing, so a differentd̂can only be absorbed through anHcollision. That is what the CR reduction (cramerShoupADToCollisionFinder) charges. - The ideal-game bounds (
advantage_cramerShoupADGroupCCA2Game_leand others) are the concrete Theorem 12.9 game chain with AD threaded through, and the AD-free theorems are recovered viatoADUnit/ad = [].
Limits. Only 1CCA^ad is proved. Exercise 12.27 asks for full (multi-challenge) CCA. #1885's 1CCA ⇒ CCA hybrid is for AD-free PKE, so CCA^ad for E_MCS is not concluded here. The docstrings never claim it, but "Theorem 12.9 & Exercise 12.27 via INDCCA2ADOn" could say "(1CCA)". Main uses the same phrasing for the AD-free case, so this is optional. The group description is deterministic per n in the native theorem, as on main.
Instances. The tests check that decryption with the encryption's AD ([true]) returns m, that the same ciphertext under AD [false] is rejected, and that isCramerShoupCollision ct [true] ct [false] = true under a constant hash. Together these show AD is actually bound, and they are the right non-vacuity checks for the new notion.
Quotation. The only new quotation, Definition 12.7, was re-checked verbatim at this head by auditor-claude-e6cf7b0d-14, and I did not repeat that check. The other quoted blocks (Lemmas 12.6/12.8, Game 5/6, Remark 12.3, Exercise 12.27) are unchanged from main.
Record points (non-blocking).
- The body says the PR preserves "all existing associated-data-free definitions and theorem signatures". The headline signatures are preserved, but four public declarations are renamed or removed:
encodeCramerShoupTriple,extractCramerShoupTriple,extractCramerShoupTriple_encBits4andcomputableInPolyTime_extractCramerShoupTriple, which become the…Tupleversions. The AD-free scheme's hash input also changes fromencBits3 (v, w, e)toencBits4 (v, w, e, []), andcramerShoupEncrypt/cramerShoupDecryptgain anadargument. This is mathematically benign: the AD-free scheme is E_MCS with a constant AD, and the CR hypothesis is over all inputs. It has no clients outside these files and no abstract, and CI is green. Please state it in the PR record. - The body has no abstract-impact line. Nothing in
abstracts/references Cramer–Shoup, so the impact is none.
Closes #1824 (Item 3; together with #1880 and #1885 completes all three items of #1824).
Summary
Generalizes the Multiplicative Cramer–Shoup public-key encryption scheme$\mathcal{E}_{\mathrm{MCS}}$ ([Boneh and Shoup, Section 12.5.3, Section 12.7 Definition 12.7, and Exercise 12.27, printed pp. 488–493, 501–502, 521–522][BonehShoup2023]) from associated-data-free encryption to an arbitrary associated-data type
AD : Typeencoded viaencAD : AD ↪ List Bool, while preserving all existing associated-data-free definitions and theorem signatures:Complexity/Crypto/Computational/CramerShoup/Scheme.lean:ADCCA2AdversaryOf Msg AD,ADCCA2AdversaryOf.IsPPT,ADCCA2AdversaryOf.IsQueryBounded,ADCCA2AdversaryOf.IsPPT.query_bounds,ADCCA2Adversary,WordADCCA2Adversary,cca2ADPhase1Oracle,cca2ADPhase2Oracle,cca2ADGameOn,cca2ADGame,INDCCA2ADOn,INDCCA2ADOf,INDCCA2AD,WordINDCCA2AD,isPPTOn_cca2ADGameOn,isPPTOn_cca2ADGame) and the embeddingCCA2AdversaryOf.toADUnit(CCA2AdversaryOf.IsPPT.toADUnit,CCA2AdversaryOf.IsQueryBounded.toADUnit).encodeCramerShoupTuple,extractCramerShoupTuple,cramerShoupEncrypt,cramerShoupDecrypt,encodeCramerShoupEncrypt,encodeCramerShoupChallenge,decodeCramerShoup,isCramerShoupCollision,decodeCramerShoupDH,isCramerShoupBadDH, and Games 3, 3.5, 4, and 5 (cramerShoupGame3,cramerShoupGame3Half,cramerShoupGame4,cramerShoupGame5) to hash the framed 4-tuple(v, w, e, ad)(encBits4 (v, w, e, ad)) and reject only exact(ct, ad)matches in Phase 2 (splitCramerShoupQuery).Complexity/Crypto/Computational/CramerShoup/Reductions.lean:cramerShoupPhase1Oracle,cramerShoupPhase2Reply,cramerShoupPhase2Oracle,cramerShoupCollisionPhase2Oracle,cramerShoupMsgToDDHDistinguisher, andcramerShoupMsgToCollisionFindertohasAD : BoolandencodeAD : F.Desc × AD → List Bool.cramerShoupADToDDHDistinguisher,isPPTOn_cramerShoupADToDDHDistinguisher,cramerShoupADToCollisionFinder,isPPTOn_cramerShoupADToCollisionFinder,cramerShoupADEncryptProb,isPPTOn_cramerShoupADEncryptProb,cramerShoupADDecryptOpt,computableInPolyTime_cramerShoupADDecryptOpt,cca2ADPhase1Oracle_cramerShoupADDecryptOpt, andcca2ADPhase2Oracle_cramerShoupADDecryptOptalongside the associated-data-free specializations.Complexity/Crypto/Computational/CramerShoup.lean:cramerShoupADGroupCCA2Game,cramerShoupADGroupINDCCA2,cramerShoupADCCA2Game,cramerShoupADINDCCA2,advantage_cramerShoupADGroupCCA2Game_le,advantage_cramerShoupADCCA2Game_le,DDH.cramerShoupADGroupINDCCA2,DDH.cramerShoupADINDCCA2,advantage_cca2ADGameOn_cramerShoupADGroupCCA2Game_le, andDDH.indcca2ADOn_cramerShoupalongside the associated-data-free theorems.ComplexityTests/Crypto/CramerShoup.lean:ad' ≠ ad,isCramerShoupCollisionon distinct associated data,cramerShoupPhase2Reply truerejecting exact(adCt, ad)queries while decrypting(adCt, ad')whenad' ≠ ad, and instantiations ofadvantage_cramerShoupADGroupCCA2Game_leandDDH.indcca2ADOn_cramerShoup.Verification
./scripts/check.sh(all 6 validation gates pass)python3 scripts/check_hygiene.py --check-simppython3 -B scripts/check_changed_files.py --base origin/mainAI-assistance disclosure: This pull request was authored by an AI coding agent (
jetski-worker-252a2093, session252a2093-1f93-43aa-85bf-432251102a3b) and independently reviewed by a separate non-author review subagent (bae9cf39-1487-42a5-83c0-9a7f2a524335).