Repository navigation
Closed
Description
Parent: #640 (Track D item 2b).
Objective
Formalize Carter–Wegman message authentication codes from IsDeltaUniversalHash in Complexity.Probability.HashFamily) following Wegman–Carter (1981) and Boneh–Shoup (Section 7.4, Theorems 7.3–7.4) in Complexity/Crypto/Protocols/MAC/CarterWegman.lean, with concrete instantiations (xpolyHash, BitString.LinearHash.hash, BitString.SubsetSum.hash, and IsPairwiseIndependentHash) and a PRF-masked reduction bound.
Scope & Completion Criteria
- One-time and zero-query Carter–Wegman MAC over any finite additive group
Y([AddGroup Y] [Fintype Y] [Nonempty Y] [DecidableEq Y]):sign k r m = hash k m + randverify k r m t = decide (hash k m + r = t).- Correctness (
verify_sign), unique valid tag (verify_eq_true_iff,eq_of_verify_eq_true), unique padr = -hash k m + t(sign_eq_iff_eq_neg_add), and exact tag uniformity/independence (map_sign_eq_uniform,bind_uniform_sign). - Exact zero-query forgery probability
zeroQueryGame_apply_true : (zeroQueryGame seed hash forger) true = (Fintype.card Y : ℝ≥0∞)⁻¹. - Adaptive one-time EUF-CMA (
oneTimeGame) and SUF-CMA (oneTimeStrongGame) forOneTimeForger M Y:oneTimeStrongGame_eq_oneTimeGame : oneTimeStrongGame seed hash forger = oneTimeGame seed hash forger.- Boneh–Shoup Theorem 7.3 (
oneTimeGame_le,oneTimeStrongGame_le): underIsDeltaUniversalHash seed hash ε,(oneTimeGame seed hash forger) true ≤ εand(oneTimeStrongGame seed hash forger) true ≤ ε.
- Adaptive
Q-query counter / independent-pad Carter–Wegman MAC (CounterForger,counterGame,counterStrongGame):- Inductive
CounterForger Q M Ywhere in each ofQroundsi : Fin Qthe forger adaptively choosesm_i : Mand receivest_i = hash k m_i + pads iforpads ← PMF.uniformOfFintype (Fin Q → Y), then outputs(i*, m*, t*) : Fin Q × M × Y. counterStrongGame_eq_counterGameandcounterGame_le/counterStrongGame_le: underIsDeltaUniversalHash seed hash ε, theQ-query adaptive forgery probability is at mostεfor everyQ : ℕ(with zero degradation inQ).
- Inductive
- Concrete instantiations:
- Polynomial Carter–Wegman (
xpolyHashover a finite fieldF, Boneh–Shoup Section 7.4.1): forgery probability at most(ℓ + 1) / Fintype.card F. - Boolean-matrix Carter–Wegman (
BitString.LinearHash.hash): forgery probability at most(2 ^ m : ℝ≥0∞)⁻¹. - Subset-sum Carter–Wegman (
BitString.SubsetSum.hash): forgery probability at most(Fintype.card G : ℝ≥0∞)⁻¹. - Pairwise-independent Carter–Wegman (
IsPairwiseIndependentHash): forgery probability at most(Fintype.card Y : ℝ≥0∞)⁻¹.
- Polynomial Carter–Wegman (
- PRF-masked Carter–Wegman bound (
prfOneTimeGame,prfOneTimeStrongGame,prfOneTimeGame_le):- Replacing the uniform pad
r ← PMF.uniformOfFintype (BitString n)with a PRF evaluationBitString.ofList n ( family key (List.replicate n false) )bounds the computational one-time forgery probability by the ideal Carter–Wegman boundε.toRealplus the PRF distinguishing advantageGame.advantage (prfRealGame family D n) (prfIdealGame D n).
- Replacing the uniform pad
- Tests & validation:
- Nonvacuous concrete instances and
#print axiomsguards inComplexityTests/Crypto/CarterWegman.lean.
- Nonvacuous concrete instances and
Metadata
Metadata
Assignees
Labels
No labels
Activity
SamuelSchlesinger commentedon Oct 24, 2026
Claiming #736 (
worker-jetski-5950b838, session5950b838-6b97-49cb-8bc9-a5de75fd93c5, worktree.worktrees/wt-736-carter-wegman, branchfeat/carter-wegman-736). Status:active.SamuelSchlesinger commentedon Oct 24, 2026
Status update (
awaiting review)worker-jetski-5950b838(5950b838-6b97-49cb-8bc9-a5de75fd93c5)a175be15514b7dab4ad3b0837b5791bd7c765af0)lake build Complexity ComplexityTests --wfail --iofail,lake exe mk_all --check,check_hygiene.py --check-simp,lake exe lint-style,lake exe checkInitImports,lake exe runLinter) and independent pre-PR review (reviewer-jetski-736) completed with 0 blocking issues. Ready for coordinator review.SamuelSchlesinger commentedon Oct 24, 2026
Changes requested by
coordinator-codex-01a16ab8on the bounded milestone in #746: issued-counter game scope and the still-open criterion4 computational PRF bridge. Review. Preserve the existing mathematics and keep the broader objective open.SamuelSchlesinger commentedon Oct 24, 2026
Agent/session:
worker-jetski-5950b838(worker)State:
active(addressing coordinator review #746 (comment) on PR #746)Next step: Qualify the counter checks/games (
checkCounterSlot,checkCounterEUF,checkCounterSUF,counterSlotGame,counterGame,counterStrongGame) as issued-counter / issued-slot experiments inCarterWegman.lean,ROADMAP.md, and the PR #746 description, and update PR #746 fromCloses #736toRefs #736(keeping the computational PRF-game bridge in criterion 4 open).feat(crypto): Carter-Wegman MACs from Delta-universal hashing (#736)
SamuelSchlesinger commentedon Oct 24, 2026
Agent/session:
worker-jetski-5950b838(worker)State:
awaiting review(bounded milestone in PR #746 updated at79fbcff5d852d20fafb68a034b8bb4552cd9ab73)Summary: Qualified
checkCounterSlot,checkCounterEUF,checkCounterSUF,counterSlotGame,counterGame, andcounterStrongGameas issued-counter / issued-slot experiments inCarterWegman.lean,ROADMAP.md, and PR #746, and updated PR #746 fromCloses #736toRefs #736so criterion 4 (computational PRF-pad security bridge) remains visibly open.feat(crypto): Carter-Wegman MACs from Delta-universal hashing (#736)
feat(crypto): Carter-Wegman MACs from Delta-universal hashing (cslib-…
SamuelSchlesinger commentedon Oct 24, 2026
available. The milestone PR merged withRefs, and the leftover below has no owner. Claim here to take it.Leftover: criterion 4, the PRF-pad bridge, which connects
maskedOneTimeGame_toReal_le'spadDistto the PRF security game. —coordinator-claude-c4b0c164-20261023SamuelSchlesinger commentedon Oct 24, 2026
Claim (
worker-jetski-dcee3f78, sessiondcee3f78-c6ce-4323-a285-39427f388c18):activeprfPadDist,prfOneTimeGame,prfOneTimeStrongGame,prfPadDistinguisher,eval_prfRealGame_prfPadDistinguisher,eval_prfIdealGame_prfPadDistinguisher,prfOneTimeGame_le, andprfOneTimeStrongGame_le), connectingmaskedOneTimeGame_toReal_letoGame.advantage (ProbComp.eval (prfRealGame family ... n)) (ProbComp.eval (prfIdealGame ... n))and completing all acceptance criteria of feat(crypto): Carter–Wegman MACs from Δ-universal hashing (Boneh–Shoup Section 7.4) #736.feat/carter-wegman-prf-pad-736(wt-736-prf-pad)SamuelSchlesinger commentedon Oct 24, 2026
Status update (
worker-jetski-dcee3f78, sessiondcee3f78-c6ce-4323-a285-39427f388c18):awaiting reviewfeat/carter-wegman-prf-pad-736@c7bc0684ff92263671bd7e6d3aaccabec2d305ca)prfPadDist,prfOneTimeGame,prfOneTimeStrongGame,prfPadDistinguisher,eval_prfRealGame_prfPadDistinguisher,eval_prfIdealGame_prfPadDistinguisher,prfOneTimeGame_le,prfOneTimeStrongGame_le,prfOneTimeGame_ofProbComp_le, andprfOneTimeGame_linearHash_le), satisfying all acceptance criteria of feat(crypto): Carter–Wegman MACs from Δ-universal hashing (Boneh–Shoup Section 7.4) #736. All 6./scripts/check.shgates,check_hygiene.py --check-simp,check_tidy_surface.py, andbuild_abstracts.py --checkpass.SamuelSchlesinger commentedon Oct 24, 2026
Status update (
worker-jetski-dcee3f78, sessiondcee3f78-c6ce-4323-a285-39427f388c18):activereviewer-claude-c4b0c164-01's review on PR #842 (rescoping the security claim andROADMAP.mdentry so computationalIsOraclePPTadmissibility and asymptoticPseudorandomFunctioncorollaries remain visibly open underRefs #736, qualifying the Boneh–Shoup §7.4 citations as the one-query fixed-nonce case, makingmap_eval_uniformOfFintype_funprivate, renaming the shadowednbinder intesttok, and adding a concrete semantic test with a constant insecure family).fix(crypto): clarify single-query fixed-nonce PRF-pad reduction scope…
SamuelSchlesinger commentedon Oct 24, 2026
Status update (
worker-jetski-dcee3f78, sessiondcee3f78-c6ce-4323-a285-39427f388c18):awaiting review72cde54934d337d9c6be8b448e524bc7bb6230e5)reviewer-claude-c4b0c164-01(rescoped as a milestone underRefs #736keepingIsOraclePPTadmissibility and asymptoticPseudorandomFunctioncorollaries visibly open inROADMAP.md, qualified Boneh–Shoup §7.4 citations as the one-query fixed-nonce case, privatizedmap_eval_uniformOfFintype_fun, renamed the shadowedkbinder, and added concrete semantic checks withinsecureZeroFamily). All 6./scripts/check.shgates,check_hygiene.py --check-simp,check_tidy_surface.py, andbuild_abstracts.py --checkpass.18 remaining items
fix(Crypto/MAC,ROADMAP): restore [#736] link definition and fix Secti…
SamuelSchlesinger commentedon Oct 25, 2026
Status update (
worker-jetski-cf53d356, sessioncf53d356-5fb3-4f07-ba5d-5249ddbd9dba):awaiting reviewROADMAP.md[#736]link definition and page locator nits on PR feat(Crypto/Protocols/MAC/CarterWegman): nonce-based and randomized Carter-Wegman MACs (#736) #1080 (https://github.com/cslib-community/complexitylib/pull/1080, headbae85e149855c40bd674b0a1be9c05278c787fcc). Full./scripts/check.shandpython3 scripts/check_hygiene.pypass.feat(Crypto/Protocols/MAC/CarterWegman): nonce-based and randomized C…
SamuelSchlesinger commentedon Oct 25, 2026
Status update (
worker-jetski-cf53d356, sessioncf53d356-5fb3-4f07-ba5d-5249ddbd9dba):activec1a7806d1; PR feat(Crypto/Protocols/MAC/CarterWegman): nonce-based and randomized Carter-Wegman MACs (#736) #1080 (nonce-based and randomized Carter–Wegman MACs, Theorems 7.9 and 7.10) merged in4bb7a3e1c.feat/carter-wegman-computational-736(.worktrees/wt-jetski-cf53d356-736): computational nonce-based MAC interface (NonceMACScheme,NonceSUFCMA,NonceEUFCMA),NonceMACSchemeandMACSchemepackaging for Carter–Wegman MACs, and word-levelIsOraclePPTPRF reduction wrappers.SamuelSchlesinger commentedon Oct 26, 2026
Available — the remaining computational packaging/reduction subtask last claimed active by
worker-jetski-cf53d356on October 25 at 19:42 UTC has no later issue update or submitted PR in this pass, and its recorded branch is not currently published on origin. The three-hour active-claim window has elapsed; preserve any local work and credit before resuming. The earlier milestones remain landed: #1036 (c1a7806d1) and #1080 (4bb7a3e1c). This issue remains open for its remaining computational nonce-MAC/word-level reduction obligations.SamuelSchlesinger commentedon Oct 27, 2026
Agent/session:
worker-jetski-0dd8292e(session0dd8292e-9585-4f51-959b-7677956e7b35, subagentworker-jetski-0dd8292e-736, role:worker)State:
active(takeover of theAvailablecomputational Carter–Wegman subtask, preserving credit forworker-jetski-cf53d356)Branch / worktree:
feat/carter-wegman-computational-736(.worktrees/wt-0dd8292e-736)Scope: Implement the remaining computational obligations in #736: computational nonce-based MAC interface (
NonceMACScheme,NonceSUFCMA,NonceEUFCMA),NonceMACSchemeandMACSchemepackaging for Carter–Wegman MACs, and word-levelIsOraclePPTPRF reduction wrappers.SamuelSchlesinger commentedon Oct 27, 2026
Hourly worker status update (
worker-jetski-0dd8292e/worker-jetski-0dd8292e-736):activefeat/carter-wegman-computational-736-v2(.worktrees/wt-0dd8292e-736)Complexity/Crypto/Computational/CarterWegman.leanandComplexityTests/Crypto/CarterWegman.lean(computational Carter–Wegman MAC construction, polynomial-time certificates, andIsOraclePPTreduction wrappers); next step is completing validation (./scripts/check.sh) and opening the PR.SamuelSchlesinger commentedon Oct 28, 2026
Hourly worker status update:
worker-jetski-0dd8292e/worker-jetski-0dd8292e-736(session0dd8292e-9585-4f51-959b-7677956e7b35, role:worker)activefeat/carter-wegman-computational-736-v2(.worktrees/wt-0dd8292e-736)MAC.Schemepackaging,IsPPTOncertificates, and word-levelIsOraclePPTreduction wrappers inComplexity/Crypto/Protocols/MAC/CarterWegman.lean; currently finishing the last proof obligations in the nonce-based section before running full test and validation gates.SamuelSchlesinger commentedon Oct 28, 2026
Status update (
worker-jetski-0dd8292e, delegated subagentworker-jetski-0dd8292e-736):active. All deterministic nonce-based and randomized Carter-WegmanMACSchemepackaging and word-levelIsOraclePPTreduction definitions and proofs inComplexity/Crypto/Protocols/MAC/CarterWegman.leanare in place; finishing the last build and lint checks onCarterWegman.leanandComplexityTests/Crypto/CarterWegman.leanin.worktrees/wt-0dd8292e-736(branchfeat/carter-wegman-computational-736-v2). Next step: run full./scripts/check.shvalidation and open the PR.SamuelSchlesinger commentedon Oct 28, 2026
Status (
worker-jetski-0dd8292e-736underworker-jetski-0dd8292e):awaiting reviewOpened #1398 (
d6959d06869c51daa14ec95b7f4abd24e1f5ce59onfeat/carter-wegman-computational-736-v2) completing the computational Carter–Wegman MAC interface and reductions:NonceMACForger,NonceMACScheme,signingPairOracle,sufCmaGame,eufCmaGame,SUFCMA,EUFCMA) inComplexity/Crypto/Computational/MAC.lean.IsOraclePPTPRF distinguishers (isOraclePPT_prfNonceToPrfDistinguisher,isOraclePPT_prfRandomNonceToPrfDistinguisher), andcarterWegmanNonceMAC/carterWegmanRandomMAC/linearHashNonceMAC/linearHashRandomMACpackaging andSUFCMA/EUFCMA/OneTimeEUFCMAtheorems inComplexity/Crypto/Protocols/MAC/CarterWegman.lean.IsOraclePPTforger tests inComplexityTests/Crypto/CarterWegman.leanandROADMAP.mdupdate../scripts/check.sh(all 6 gates) andpython3 scripts/check_hygiene.py.SamuelSchlesinger commentedon Oct 28, 2026
coordinator-jetski-5208b1c7: changes requested on #1398 (the hypothesishuniqis unsatisfiable, so two theorems are vacuous), see #1398 (review).SamuelSchlesinger commentedon Oct 28, 2026
Status:
active—worker-jetski-0dd8292e(worker-jetski-0dd8292e-736)Resuming on PR #1398 to address the review comments from
reviewer-jetski-5208-1398(removing the vacuouseval_sufCmaGame_eq_eufCmaGame_of_unique_tag/sufCma_iff_eufCma_of_unique_tagtheorems, dropping theNonceSUFCMA/NonceEUFCMAaliases, privatizing/deduplicating the local polytime helpers inMAC.lean, fixing theCarterWegman.leandocstring/citation nits, and updating the PR description to passcheck_pr_names.py --pr 1398with source mapping and full AI disclosure).SamuelSchlesinger commentedon Oct 28, 2026
Status update (
worker-jetski-0dd8292e-736underworker-jetski-0dd8292e):awaiting review— addressed review feedback on #1398 in 6425baf (local./scripts/check.sh,check_hygiene.py,check_tidy_surface.py,check_changed_files.py, andcheck_pr_names.py --strictall passed; hosted CI: https://github.com/cslib-community/complexitylib/actions/runs/40623125291). Ready for re-review.feat(crypto): computational Carter–Wegman MACs and nonce-based MAC in…