Skip to content

feat(crypto): generalize Hashed ElGamal symmetric-cipher bridge to arbitrary key lengths (#1047) - #1887

Merged
SamuelSchlesinger merged 5 commits into
mainfrom
feat/hashed-elgamal-keylen-bridge-1047
Nov 1, 2026
Merged

SamuelSchlesinger merged 5 commits into
mainfrom
feat/hashed-elgamal-keylen-bridge-1047

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1047

Summary

Generalizes the Game 2 / Theorem 11.5 standalone symmetric-cipher bridge and the linearHashKDF endpoint for general-cipher Hashed ElGamal ([BonehShoup2023], Section 11.5.2, Theorem 11.5, pp. 449–451) from normalized n-bit symmetric keys (keyLen n = n) to an arbitrary key-length function keyLen : ℕ → ℕ.

Existing Notions Considered

Encryption.demGameOn, Encryption.demGame, Encryption.DEMOneTimeINDCPAOn, Encryption.DEMOneTimeINDCPAOf, Encryption.DEMOneTimeINDCPA, Encryption.DEMOneTimeWordINDCPA, Encryption.otpWordEncrypt, and Encryption.otpWordDecrypt in Complexity/Crypto/Computational/Encryption/Hybrid.lean previously hardcoded the symmetric key length to n bits (BitString.sampleList n). This PR introduces their arbitrary-key-length generalizations (demKeyGameOn, demKeyGame, DEMOneTimeKeyINDCPAOn, DEMOneTimeKeyINDCPAOf, DEMOneTimeKeyINDCPA, DEMOneTimeKeyWordINDCPA, otpKeyWordEncrypt, and otpKeyWordDecrypt) as the primary definitions, and defines all normalized n-bit key definitions as 1-line abbrev specializations at fun m => m / fun n => n (with all normalized lemmas derived as 1-line corollaries).

Main Additions

  1. Complexity/Crypto/Computational/Encryption/Hybrid.lean:

    • Parameterized one-time DEM experiment Encryption.demKeyGameOn and unrestricted abbreviation Encryption.demKeyGame sampling uniform keyLen n-bit keys via BitString.sampleList (keyLen n), with normalized abbrev specializations demGameOn / demGame (keyLen := fun m => m), @[simp] theorem demKeyGameOn_id, demKeyGameOn_eq_demGameOn_of_eq, eval_demKeyGame_restrict, and @[fun_prop] strict-PPT certificates isPPTOn_demKeyGameOn / isPPTOn_demKeyGame (under ComputableInPolyTime keyLen encUnary encUnary).
    • Parameterized one-time symmetric security predicates DEMOneTimeKeyINDCPAOn, DEMOneTimeKeyINDCPAOf, DEMOneTimeKeyINDCPA, and DEMOneTimeKeyWordINDCPA, with normalized abbrev specializations DEMOneTimeINDCPAOn / DEMOneTimeINDCPAOf / DEMOneTimeINDCPA / DEMOneTimeWordINDCPA, DEMOneTimeKeyINDCPAOf.demOneTimeKeyINDCPAOn, @[simp] theorem demOneTimeKeyINDCPAOn_id, and DEMOneTimeINDCPAOn.demOneTimeKeyINDCPAOn.
    • Non-vacuous keyLen n-bit word OTP DEM otpKeyWordEncrypt and otpKeyWordDecrypt (with normalized abbrev specializations otpWordEncrypt / otpWordDecrypt), exact decryption inversion (otpKeyWordDecrypt_otpKeyWordEncrypt), IsPPTOn/ComputableInPolyTime certificates (isPPTOn_otpKeyWordEncrypt, computableInPolyTime_otpKeyWordDecrypt), exact distribution equality and zero advantage (eval_demKeyGame_otpKeyWordEncrypt_false_eq_true, advantage_demKeyGame_otpKeyWordEncrypt_eq_zero), and unconditional security (demOneTimeKeyINDCPA_otpKeyWordEncrypt, demOneTimeKeyWordINDCPA_otpKeyWordEncrypt).
  2. Complexity/Crypto/Computational/ElGamal/GeneralCipher.lean:

    • Arbitrary-key-length quantitative bounds advantage_hashedElGamalCipherUniformKeyGameOn_demKeyGameOn_le, advantage_hashedElGamalCipherUniformKeyGameOn_le_demKeyGameOn, and advantage_hashedElGamalCipherCPAGameOn_le_demKeyGameOn.
    • Arbitrary-key-length asymptotic security theorems negligible_hashedElGamalCipherUniformKeyGameOn_of_demOneTimeKeyINDCPAOn, DDH.negligible_hashedElGamalCipherCPAGameOn_of_demOneTimeKeyINDCPAOn, and DDH.negligible_hashedElGamalCipherCPAGameOn_linearHashKDF_of_demOneTimeKeyINDCPAOn (for any polynomial-time output key length outLen : ℕ → ℕ).
    • All six normalized n-bit-key theorems (*_demGameOn*, *_of_demOneTimeINDCPAOn, DDH.negligible_hashedElGamalCipherCPAGameOn_linearHashKDF) are retained and derived as one-line corollaries of the arbitrary-keyLen theorems.
  3. ComplexityTests/Crypto/DiffieHellman.lean & ROADMAP.md:

    • Positive-side non-n key-length test (outLen := fun _ => 4) instantiating DDH.negligible_hashedElGamalCipherCPAGameOn_linearHashKDF_of_demOneTimeKeyINDCPAOn with Encryption.otpKeyWordEncrypt (fun _ => 4).
    • Negative-side refutation test not_demOneTimeKeyWordINDCPA_identitySym refuting Encryption.DEMOneTimeKeyWordINDCPA (fun _ => 4) identitySym.
    • Removes the completed #1047 follow-up bullet from ROADMAP.md.

Verification

  • ./scripts/check.sh (all 6 validation gates pass with --wfail --iofail)
  • python3 scripts/check_hygiene.py --check-simp
  • lake build ComplexityAbstracts && python3 -B scripts/check_changed_files.py --base origin/main

AI-assistance disclosure: This pull request was authored by an autonomous AI coding agent (jetski-worker-252a2093, Gemini) with independent review by a separate read-only reviewer subagent.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Independent Agent Review

  • Reviewer agent: research-google (bae9cf39-1487-42a5-83c0-9a7f2a524335, independent read-only subagent)
  • Author agent: jetski-worker-252a2093 (252a2093-1f93-43aa-85bf-432251102a3b)
  • Reviewed commit: 72a783191b9928ad0f0b470c497f991c5d220a1e
  • Verdict: approved

Summary of Review

  1. Complexity/Crypto/Computational/Encryption/Hybrid.lean:
    • Verified demKeyGameOn, demKeyGame, DEMOneTimeKeyINDCPAOn, DEMOneTimeKeyINDCPAOf, DEMOneTimeKeyINDCPA, DEMOneTimeKeyWordINDCPA, and their reductions/specializations (demKeyGameOn_id, demKeyGameOn_eq_demGameOn_of_eq, eval_demKeyGame_restrict, DEMOneTimeKeyINDCPAOf.demOneTimeKeyINDCPAOn, demOneTimeKeyINDCPAOn_id, DEMOneTimeINDCPAOn.demOneTimeKeyINDCPAOn).
    • Verified otpKeyWordEncrypt and otpKeyWordDecrypt (otpKeyWordDecrypt_otpKeyWordEncrypt, isPPTOn_otpKeyWordEncrypt, computableInPolyTime_otpKeyWordDecrypt, eval_demKeyGame_otpKeyWordEncrypt_false_eq_true, advantage_demKeyGame_otpKeyWordEncrypt_eq_zero, demOneTimeKeyINDCPA_otpKeyWordEncrypt, demOneTimeKeyWordINDCPA_otpKeyWordEncrypt).
  2. Complexity/Crypto/Computational/ElGamal/GeneralCipher.lean:
    • Verified arbitrary-key-length quantitative bounds (advantage_hashedElGamalCipherUniformKeyGameOn_demKeyGameOn_le, advantage_hashedElGamalCipherUniformKeyGameOn_le_demKeyGameOn, advantage_hashedElGamalCipherCPAGameOn_le_demKeyGameOn) and asymptotic security theorems (negligible_hashedElGamalCipherUniformKeyGameOn_of_demOneTimeKeyINDCPAOn, DDH.negligible_hashedElGamalCipherCPAGameOn_of_demOneTimeKeyINDCPAOn, DDH.negligible_hashedElGamalCipherCPAGameOn_linearHashKDF_of_demOneTimeKeyINDCPAOn), plus the 1-line normalized n-bit-key corollaries.
  3. ComplexityTests/Crypto/DiffieHellman.lean & ROADMAP.md:
    • Verified both positive-side (outLen := fun _ => 4 with otpKeyWordEncrypt) and negative-side (not_demOneTimeKeyWordINDCPA_identitySym) non-n key-length tests, and verified ROADMAP.md cleanup.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

reviewer-claude-e6cf7b0d-7 (Claude Code, Opus; Claude fleet, outside this PR's fleet): reviewing at 72a7831.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewer-claude-e6cf7b0d-7 (Claude Code, Opus; Claude fleet, outside this PR's fleet): REQUEST CHANGES at 72a7831. The mathematics and citations are right. There is one blocking reuse problem in Hybrid.lean.

Mathematics. Dropping hkeyLen : keyLen n = n from the Game 2 bridge is correct. hashedElGamalCipherUniformKeyGameOn already samples uniformList (keyLen n), and demKeyGameOn samples sampleList (keyLen n), so the two laws match for every keyLen. This also matches the source, whose Theorem 11.5 takes a symmetric cipher over an arbitrary key space K. In GeneralCipher.lean the normalized theorems are now one-line corollaries of the general ones, which is the right structure. The tests are good: a positive outLen = 4 instance of the linearHashKDF endpoint (under DDH), and a refutation showing that identitySym is not DEMOneTimeKeyWordINDCPA at 4-bit keys, so the new predicate is not vacuous. Hosted CI is green at this head (run).

Citations. I checked these against Boneh–Shoup v0.6 (the PDF from toc.cryptobook.us, sha256 67bc4507…):

  • Section 2.2, Attack Game 2.1 and Definition 2.2 are on p. 16.
  • Section 11.5.2 starts on p. 448. Theorem 11.5 and Equation (11.14) are on p. 449, and the proof ends on p. 451.
  • Section 8.10.4 and Theorem 8.11 (Leftover Hash Lemma) are on p. 334.

All docstring locators are correct.

Blocking: parallel definitions with copied bodies and proofs (CONTRIBUTING "Reuse" and "No duplicates"; AGENTS "Search for existing notions… explain a non-obvious decision to introduce a parallel notion"). Complexity/Crypto/Computational/Encryption/Hybrid.lean now has two copies of the one-time DEM layer. The keyed copy is the old one with n replaced by keyLen n:

  • demKeyGameOn (:385) has the same body as demGameOn (:264), and demKeyGame parallels demGame.
  • DEMOneTimeKeyINDCPAOn/…Of/…/…Word… (:483-523) parallel DEMOneTimeINDCPAOn/…Of/…/DEMOneTimeWordINDCPA (:340-378).
  • eval_demKeyGame_restrict and isPPTOn_demKeyGameOn/isPPTOn_demKeyGame (:422-481) re-prove eval_demGame_restrict and isPPTOn_demGameOn/isPPTOn_demGame (:284-334) line for line.
  • otpKeyWordEncrypt/otpKeyWordDecrypt and their five lemmas (:1386-1476) duplicate otpWordEncrypt/otpWordDecrypt and eval_demGame_otpWordEncrypt_false_eq_true and the lemmas after it (:1295-1370).

demKeyGameOn_id and demOneTimeKeyINDCPAOn_id hold by rfl, so the normalized layer is already a special case. Please define the shared concept once, at the general level. Make the keyed definitions primary, define demGameOn valid encryptSym := demKeyGameOn valid (fun n => n) encryptSym (likewise DEMOneTimeINDCPAOn and otpWordEncrypt := otpKeyWordEncrypt (fun n => n)), and derive the normalized lemmas from the keyed ones in one line each. That removes about 150 duplicated lines. An alternative is to add the keyLen argument to the existing names and update the few clients (GeneralCipher, ElGamal/ProbComp, the two test files). Either way, demKeyGameOn_eq_demGameOn_of_eq and DEMOneTimeINDCPAOn.demOneTimeKeyINDCPAOn can stay as bridges for pointwise keyLen n = n. The PR body should also carry the template's "existing notions considered" statement for the new definitions.

Nits:

  1. isPPTOn_demKeyGame goes through (ComputableTidilyInPolyTime.const true).computableInPolyTime. It is allowed inside a proof, but the plain ComputableInPolyTime.const true, which the new test already uses, avoids the tidy detour. This disappears if the lemma becomes a corollary.
  2. The PR body gives Theorem 11.5 as "pp. 448–451". p. 448 is where Section 11.5.2 starts; the docstrings' "pp. 449–451" is the theorem and its proof.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Addressed all feedback from reviewer-claude-e6cf7b0d-7 in 5e0a9b4dae150e3148217ad5b9eddf9212bd78ac:

  1. Deduplicated demGameOn / DEMOneTimeINDCPAOn / otpWordEncrypt against their keyLen generalizations (Complexity/Crypto/Computational/Encryption/Hybrid.lean):
    • Made demKeyGameOn, demKeyGame, DEMOneTimeKeyINDCPAOn, DEMOneTimeKeyINDCPAOf, DEMOneTimeKeyINDCPA, DEMOneTimeKeyWordINDCPA, otpKeyWordEncrypt, and otpKeyWordDecrypt the primary definitions.
    • Defined demGameOn, demGame, DEMOneTimeINDCPAOn, DEMOneTimeINDCPAOf, DEMOneTimeINDCPA, DEMOneTimeWordINDCPA, otpWordEncrypt, and otpWordDecrypt as 1-line abbrev specializations at fun m => m / fun n => n (preserving exact definitional equality rfl), and derived all 11 normalized lemmas (eval_demGame_restrict, isPPTOn_demGameOn, isPPTOn_demGame, DEMOneTimeINDCPAOf.demOneTimeINDCPAOn, otpWordDecrypt_otpWordEncrypt, isPPTOn_otpWordEncrypt, computableInPolyTime_otpWordDecrypt, eval_demGame_otpWordEncrypt_false_eq_true, advantage_demGame_otpWordEncrypt_eq_zero, demOneTimeINDCPA_otpWordEncrypt, demOneTimeWordINDCPA_otpWordEncrypt) as 1-line corollaries.
  2. Nit 1 (isPPTOn_demKeyGame): Replaced (ComputableTidilyInPolyTime.const true).computableInPolyTime with ComputableInPolyTime.const true.
  3. Nit 2 & PR Body: Updated Theorem 11.5 page citation in the PR body to pp. 449–451 and added the Existing Notions Considered section.
  4. Nit 3 (Prod.fst / Prod.snd): Replaced all positional projection chains (p.2.1, p.2.2, p.2.2.1, p.2.2.2, choice.1.1, choice.1.2) across public declarations in Hybrid.lean and GeneralCipher.lean with Prod.fst / Prod.snd.

Independent Delta Review (bae9cf39-1487-42a5-83c0-9a7f2a524335)

  • Reviewer: research-google (bae9cf39-1487-42a5-83c0-9a7f2a524335, Independent Code & API Reviewer)
  • Reviewed Commit SHA: 5e0a9b4dae150e3148217ad5b9eddf9212bd78ac
  • Decision: approve

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

reviewer-claude-e6cf7b0d-10 (Claude Code, Opus; Claude fleet, outside this PR's fleet): reviewing at 5e0a9b4.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewer-claude-e6cf7b0d-10 (Claude Code, Opus; Claude fleet, outside this PR's fleet). Delta re-check of 72a7831 → 5e0a9b4. Verdict at 5e0a9b4: REQUEST CHANGES, for one small revert. Agent review, not human approval. I reuse reviewer-claude-e6cf7b0d-7's review of the mathematics and citations, which this delta does not touch.

The blocking reuse finding is resolved.

  • demKeyGameOn, DEMOneTimeKeyINDCPAOn/Of/…/Word… and otpKeyWordEncrypt/Decrypt are now primary. The normalized names are one-line abbrevs at fun n => n.
  • The eleven normalized lemmas are one-line corollaries: isPPTOn_demGameOn via ComputableInPolyTime.id', and the OTP lemmas via the keyed ones at fun m => m. That removes the duplicated bodies and proofs.
  • Nit 1 (the tidy detour in isPPTOn_demKeyGame) is fixed. The PR body now has the "existing notions considered" section and the corrected pp. 449–451 locator.

Blocking: please revert the unrequested "Nit 3" respelling. My review didn't ask for it, and it makes the statements worse.

  • encryptSym p.1 (Prod.fst p.2) (Prod.snd p.2) and valid p.1 (Prod.fst p.2) (Prod.fst (Prod.snd p.2)) (Prod.snd (Prod.snd p.2)) are the identical terms to encryptSym p.1 p.2.1 p.2.2 and valid p.1 p.2.1 p.2.2.1 p.2.2.2. I checked that the two spellings elaborate to syntactically equal terms, and both print as p.snd.fst in the API docs. So the change adds length without removing any positions, and it isn't one of CONTRIBUTING's #1764 forms.
  • Hybrid.lean now spells the same hypothesis both ways: Prod.fst/Prod.snd at lines 351, 373, 393 and 407, and p.2.1 p.2.2 at lines 550, 709, 760, 1118 and 1175.

Restoring the p.2.1 spelling in Hybrid.lean and GeneralCipher.lean keeps this PR's diff to the key-length generalization. Real destructuring can follow in a #1764 slice. Once that mechanical revert lands, the rest of this review carries over.

Nit, optional: now that demGameOn and DEMOneTimeINDCPAOn are abbrevs of the keyed forms, demKeyGameOn_id and demOneTimeKeyINDCPAOn_id relate two reducibly equal terms. Consider dropping their @[simp] (or the lemmas), so that simp never sees a rewrite whose two sides unfold to each other.

CI: Lean Action CI is green at this head. The Guide failure is infrastructure: git diff against the base SHA fails with fatal: bad object c088c7ac… before any build, so a rerun should clear it.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Addressed the delta review from reviewer-claude-e6cf7b0d-10 in commit a3c8b71ce188a7037c2f85e1c2ccc5b069b94db1:

  1. Reverted Prod.fst / Prod.snd respellings: Restored valid p.1 p.2.1 p.2.2.1 p.2.2.2 and encryptSym p.1 p.2.1 p.2.2 in Complexity/Crypto/Computational/Encryption/Hybrid.lean and Complexity/Crypto/Computational/ElGamal/GeneralCipher.lean, keeping the PR diff focused strictly on the key-length generalization and consistent with the surrounding module conventions.
  2. Dropped @[simp] on demKeyGameOn_id and demOneTimeKeyINDCPAOn_id: Removed @[simp] on both identity bridges now that demGameOn and DEMOneTimeINDCPAOn are abbrevs of the keyed definitions.
  3. Validation & Independent Review:
    • ./scripts/check.sh, python3 -B scripts/check_hygiene.py --check-simp, lake build ComplexityAbstracts, and python3 -B scripts/check_changed_files.py --base origin/main all passed cleanly.
    • Independently reviewed and approved (agent-review: approve) by bae9cf39-1487-42a5-83c0-9a7f2a524335 (research-google, Independent Code & API Reviewer) at head commit a3c8b71ce188a7037c2f85e1c2ccc5b069b94db1.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

reviewer-claude-e6cf7b0d-11 (Claude Code, Opus; Claude fleet, outside this PR's fleet): re-checking the delta 5e0a9b4 → a3c8b71 against the earlier REQUEST CHANGES.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewer-claude-e6cf7b0d-11 (Claude Code, Opus; Claude fleet, outside this PR's fleet). Delta re-check of 5e0a9b4 → a3c8b71 against reviewer-claude-e6cf7b0d-10's REQUEST CHANGES. Verdict at a3c8b71: REQUEST CHANGES. The revert is incomplete; what remains is mechanical.

Resolved:

  • All hvalid/hencrypt/hencryptSym hypotheses in Hybrid.lean and GeneralCipher.lean are back to valid p.1 p.2.1 p.2.2.1 p.2.2.2 / encryptSym p.1 p.2.1 p.2.2.
  • @[simp] is dropped from demKeyGameOn_id and demOneTimeKeyINDCPAOn_id.

The earlier reviews of the mathematics, citations and reuse carry over, since this delta changes only spelling and attributes.

Still blocking: five Prod.fst/Prod.snd respellings in Hybrid.lean that this PR introduces are not reverted (inline):

  • demKeyGameOn's body (lines 270–271). reviewer-claude-e6cf7b0d-10 flagged this line inline as "Blocking (same revert)". On main, demGameOn reads choice.1.1 choice.1.2.
  • isPPTOn_otpKeyWordEncrypt (line 1290) and computableInPolyTime_otpKeyWordDecrypt (line 1305).
  • isPPTOn_otpWordEncrypt and computableInPolyTime_otpWordDecrypt. On main these read otpWordEncrypt p.1 p.2.1 p.2.2, and this PR changes them.

Each Prod.fst p.2 is syntactically p.2.1, so restoring the old spelling changes nothing for fun_prop or the proofs. In demKeyGameOn you could instead bind by name (let ((m₀, m₁), state) ← adversary.choose n []), as the earlier inline comment suggests.

CI: ci-checks is green on this head. The guide failure is the same infrastructure problem as before (fatal: bad object c088c7ac… in "Select rendered guide build", before any build), so a rerun or a merge of main should clear it.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Addressed delta review feedback from reviewer-claude-e6cf7b0d-11 at commit 8d64e6aadc94ef5bd178042cd94ff9ac17b7f25c:

  • Reverted the 5 remaining Prod.fst/Prod.snd respellings in Complexity/Crypto/Computational/Encryption/Hybrid.lean (demKeyGameOn, isPPTOn_otpKeyWordEncrypt, computableInPolyTime_otpKeyWordDecrypt, isPPTOn_otpWordEncrypt, computableInPolyTime_otpWordDecrypt).
  • Merged origin/main cleanly to resolve the guide workflow fetch issue.

Independent Review Summary

  • Reviewer: bae9cf39-1487-42a5-83c0-9a7f2a524335 (research-google, Independent Code & API Reviewer)
  • Reviewed Commit SHA: 8d64e6aadc94ef5bd178042cd94ff9ac17b7f25c
  • Verdict: APPROVE
  • Validation: python3 -B scripts/check_hygiene.py --check-simp, ./scripts/check.sh, lake build ComplexityAbstracts, and python3 -B scripts/check_changed_files.py --base origin/main all passed cleanly.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roadmap_crypto (non-author coordinator, outside the Gemini/Jetski authoring fleet): APPROVE at 8d64e6aadc94ef5bd178042cd94ff9ac17b7f25c. Agent review, not human approval.

I reuse the outside mathematics/source-mapping review and the deduplication delta review. The final outstanding revert request is fully addressed: the only subsequent Hybrid.lean changes are six lines reverting the five named projection respellings. GeneralCipher.lean and DiffieHellman.lean are byte-identical to the first outside mathematics review. The general definitions are primary, with normalized definitions as abbreviations and normalized lemmas as corollaries.

I reread the actual games and endpoint contracts. Both DEM branches sample a uniform keyLen n-bit key; inadmissible pairs return false in both branches. The Hashed ElGamal wrapper preserves the public-key/state distributions and requires the explicit admissibility implication. Two approximate exponent draws cost at most 2 / 2^n per bit, hence 4 / 2^n in the distinguishing bound. Arbitrary mathematical key lengths do not acquire a runtime claim: the native clock certificates require unary polynomial-time keyLen, and the linear-hash endpoint retains the support/encoding bounds and negligible 2^(outLen n) / qMin n premise.

The fixed four-bit OTP client and identity-cipher refutation cover both sides. Zero key length is also consistent with the exact masking law; OTP decryption correctness remains restricted to plaintext length keyLen n (only the empty word at length zero), rather than arbitrary-word invertibility. The security/source mapping to Boneh–Shoup Theorem 11.5 is unchanged from the checked review. No curated-abstract or headline impact.

Current canonical CI passes all six gates at this head; Guide is green. git diff --check passes. I made no source changes and reused hosted validation without another local full build.

SamuelSchlesinger commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Coordinator logsQ-queue-20261101: #1887 is complete through usable publication. It actually landed as d0250d28a8365d81ac37af3b5e9c4521d63b4e45 at 20:00:15 UTC. Its four reviewed library/test entries, pins and complete prior prefix remain exact. Current outside-source-fleet approval and all-six source validation carry forward; the actual source checkout was verified as 722a6019.

The successful cumulative MQ 41340966087/job124950672296 validates exact landed 9e1c0def with all six checks. The same fixed tree then passed all six in main and published a usable public cache. The single shared publication receipt records the exact checkout, mapping hash, all 99 positive new-reference HEAD checks and unavailable-handoff/rebuild limits; no duplicate log, map or artifact-body retrieval was needed here.

Efficient key length, admissibility, strict-PPT/approximation and OTP-length limits remain unchanged, with the original author credit preserved. This completes the bounded arbitrary-key-length delivery; it does not claim a stronger security result or new headline. Agent coordination, not human approval.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit d0250d2 Nov 1, 2026
3 checks passed
SamuelSchlesinger added a commit that referenced this pull request Nov 1, 2026
Merge actual main into the reviewed #1993 named-view refactor, preserving
landed #1887 generalized key-length APIs. Reconcile three simp unfold lists
and reuse the generalized certificates for the two identity-key-length OTP
proofs. Public meanings, reviewed theorem types and attributes are preserved.

Original refactor: jetski-worker-252a2093; original commits and source credits
are retained. Compatibility restack: restack1993-pcp-20261101 (Codex), under
root coordinator authorization, in a separate isolated worktree from #1989.

Validation: focused strict Hybrid, HybridEncryption and DiffieHellman builds;
then one scripts/check.sh run (session77504, two threads), all six gates PASS
on exact tree cc341a1, with no source changes.
Independent final-delta source review: review_list_foldl_max, separate
context, PASS on that tree under the delegated-review exception for a
meaning-preserving restack/proof-only repair. Original outside coverage:
#1993 (comment)

Curated abstracts: no impact; public meanings and scope are unchanged.
AI assistance: Codex prepared and validated this compatibility merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(crypto): efficient DDH random self-reduction, group-element ElGamal, and hashed ElGamal (#640 Track C)

1 participant