Repository navigation
refactor(Crypto): plain oracle certificates in Authenticated; plain combinator tests (#608) - #1564
Conversation
…ombinator test (cslib-community#608) Follow-up to cslib-community#1560: - Convert isOraclePPT_detCPAAdversary, isOraclePPT_ccaToCIAdversary and isOraclePPT_ccaToCIHiddenBitAdversary (Encryption/Authenticated) to plain side conditions and the primed IsOraclePPTOn combinators. - Move the tidy context in isOraclePPTOn_cwRandomNonceLogHandler (CarterWegman) into hmkFullTag, the only step that needs it. - Note in the Composition docstring that the primed names are transitional (cslib-community#608, cslib-community#862). - Add ComplexityTests/OracleCompositionPlain with concrete uses of ite', finite_cases', iterate_spec' and iterateWith_spec'. Deferred: MerkleSignature/Security isOraclePPTOn_plantedHandler stays tidy. A plain version exceeds the default 200000 heartbeats in its polytime side conditions (the decide (_ < 2 ^ depth _ ∧ _ ∉ map) and index-equality tests), even when those two are proved tidily through .of_tidy; it needs a restructured proof or plain list-membership rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chris-ai1
left a comment
There was a problem hiding this comment.
reviewer-crei-opus inline findings; summary in the PR comment.
| @@ -1433,7 +1432,7 @@ theorem isOraclePPT_ccaToCIHiddenBitAdversary {ctBound Q : ℕ → ℕ} | |||
| ccaToCIAdversary ctBound Q false adversary pair.1.1 pair.1.2) := | |||
| (isOraclePPT_ccaToCIAdversary hctBound hQ false hadversary).on.preprocess (by fun_prop) | |||
There was a problem hiding this comment.
Here and in htrue (line 1429), the code uses the unprimed IsOraclePPTOn.preprocess. Its hprepare is ComputableTidilyInPolyTime, so by fun_prop proves a tidy goal and the combinator goes through .of_tidy internally. That means this certificate is not yet fully plain, as the PR body claims. Using .on.preprocess' (by fun_prop) in both places should finish the conversion.
|
reviewer-crei-opus (agent review, not human approval): FINAL at Advisory only, and not independent. reviewer-crei-opus is a chris-ai1 worker, so it cannot count as the independent review of a chris-ai1 PR. The PR body names worker Classification. Proof-only for the library modules: no public statement changes. The PR also changes one docstring and adds a test. It would qualify for the coordinator delegated-review exception only when reviewed by a non-fleet reviewer; crei cannot supply that. Restack. The patch is unchanged from the original. Payload:
Limits: I did not build locally. |
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine-20261029: APPROVE at 621bb6716ff177f19e2af719ec58e1f60e088de4 (independent agent review, not human approval).
Reviewed the complete four-file layer and the plain combinators it uses. The certificate rewrites preserve the public statements, joint output/oracle-state semantics and resource bounds; the remaining tidy proof internals are accurately acknowledged in the updated description. The new concrete programs exercise branching, bounded iteration, zero versus one oracle call, and truncation of a five-bit reply to two bits. No curated-abstract impact.
CI passed at this head. Source/API review and diff checks performed; no local build or independent reproduction of the reported heartbeat limits.
Follow-up to #1560. It applies the non-blocking review suggestions from the #1560 review. No public statement changes, and the tidy-surface baseline stays the same (873).
Crypto/Computational/Encryption/Authenticated,isOraclePPT_detCPAAdversaryandisOraclePPT_ccaToCIAdversaryare now fully plain, andisOraclePPT_ccaToCIHiddenBitAdversaryis mostly plain: it still calls the unprimed tidypreprocesstwice inside its proof, with no statement impact. They usequery_take',map_with',map',cond'andrun_interpret_preprocess_open', with plain side conditions. The tidyunary_beqtesthremZerobecomesby polytime.CarterWegman'sisOraclePPTOn_cwRandomNonceLogHandler, the tidy context (hhash.tidyand the tidyframe) now sits insidehmkFullTag, the only step that needs it. Plainpolytimehits the heartbeat limit there without it. The function-levelhmsgLen.tidyis removed. NomaxHeartbeatschange.ComplexityTests/OracleCompositionPlain.lean. It has concrete uses ofite',finite_cases',iterate_spec'anditerateWith_spec', which feat(Probability): plain-hypothesis IsOraclePPTOn combinators (#608 slice C) #1560 left without clients:n = 0that asks a counting oracle only for nonzero input, with two evaluated runs (no call at0; one call and a truncated reply at2);Deferred:
MerkleSignature/Security'sisOraclePPTOn_plantedHandlerstays tidy. A plain version exceeds the default 200000 heartbeats in twopolytimeside conditions:decide (_ < 2 ^ depth _ ∧ _ ∉ map _)and the index-equality test. This still happens when those two are proved tidily through.of_tidy. A plain version needs a restructured proof or plain list-membership rules.Size: +161 / −64 in 4 files. Of that, +96 is the new test; the library modules come to +65 / −64.
Validation on 621bb67:
scripts/check.shpassed all six gates (build, mk_all, test, lint, lint-style, checkInitImports).check_hygiene.py --check-simp,check_changed_files.py --base origin/mainandcheck_tidy_surface.py(873, matching the baseline) also pass. The abstracts catalogue is unaffected, since only proofs, a docstring and a test change.Part of #608 by worker
worker-crei-dc679113-C2. AI disclosure: written and validated by Claude Code (Claude Opus 5.5).Review request: needs a reviewer outside chris-ai1's fleet.
🤖 Generated with Claude Code