RFC: Budget-free dependent Interface, cumulative CR18 Systems/Converters, and endomorphism Filters
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 12/100
- issue の種類
- リファクタリング
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 領域
- cryptography
調査の方向性
This is an architectural RFC, not a task: start by reading the v2 sketch of Interface, cumulative System A and two-sided Converter A B, then look at how the existing RandomSystems/Typed/ and RandomSystems/DDC/ layers use TypedSystem, IsDDCFrom and the global bound those types are meant to remove. Phase 0 is the gate — a single PR implementing the new core plus MonoidalCategory, ResourceTheory and CompatiblePseudoMetric instances, proving the interchange law on correlated System (B ⊗ D), keeping cc_normalize/cc_calc/cc_construct working unchanged, and checking endomorphism filter absorption. Done means those instances compile with only [propext, Classical.choice, Quot.sound]; only then do the later bridge and port phases (Commons/Definitions/, downstream sequence-cc) follow.
索引モデルが issue の本文から書いたものです。
説明
Background
Two early choices in RandomSystems force substantial Lean plumbing across the library and downstream consumers (e.g., sequence-cc):
- Flat port-tagged systems plus runtime subtype wrappers (
TypedSystem,TypedGame):RandomSystemoperates on untyped alphabets, encoding multi-port systems viaΣ i : A.I, A.X i/Σ i : A.I, A.Y i. Preventing wrong-port replies requiredRepliesAtQueriedInterface(TypedSystem, ~55 files inRandomSystems/Typed/), and games added a second subtype (TypedGame, duplicating attachment, presentation, and≡g/|≡proofs). - Global query bounds baked into
Interface(domain,bound): Representing random systems via finitely-supportedPDSdistributions over complete functionsList X →. Yforced a global queryboundand[Fintype X]onto everyInterface. Consequently, unbounded primitives (PRF,URF,URP,Sponge) splinter into incompatibleq-indexed types, converters carryIsDDCFrom/MapsDomaincertificates, and downstream code inventsBoundedBytes,Limits,WorkInterface, andSeedInterfacehacks.
In Maurer's Constructive Cryptography (CR18 / MR11 / MR16), every object is an extensional algebraic system in Type 0 with no query bounds forced on Interface or on information-theoretic distinguisher classes.
Proposed change
Adopt a budget-free, pure Maurer CR18 v2 core (introduced incrementally alongside v1 with a v2 → v1 truncation bridge, leaving Probability/, Commons/Schemes/, Commons/Tests/, and all cc_normalize/cc_calc/cc_construct/cc_substitute tactics untouched):
- Minimal dependent
Interface:
Tensor isstructure Interface where X : Type Y : X → Type(A.X ⊕ B.X, fun | .inl a => A.Y a | .inr b => B.Y b)(abbrevcombinators), unit𝟙_isEmpty, with noI,domain,bound, or[Fintype X]. EliminatesTypedSystem,RepliesAtQueriedInterface, andBoundedBytes. - Sub-probabilistic cumulative systems $P_R(y^i \mid x^i)$ in
Type 0(CR18 Def. 3.8):
RepresentSystem Adirectly by its cumulative massHist A → ℝ≥0($P([]) = 1$, $\sum_y P(h \cdot (x,y)) \le P(h)$), withCoe (∀ x, A.Y x) (System A)so plain functions coerce directly (sample k ←$ 𝒰[K]; F kwithoutstateless/ofFunction). Step-kernels andProbAutomatonare lightweight constructors; cumulative laws makeSystem.extplainfunext,samplelinear, and avoid BayesnormBeliefdivision. - Limits live in primitive bodies or explicit endomorphism filters $\varphi : A \to A$ (not in
Interfaceor adversary classes $\mathcal{D}$):- Intrinsic limits (e.g., one-time key $\mathbf{K}$, single-use channel) live in that primitive's own body (mass $0$ / non-response past query $n$).
- Unbounded primitives (
PRF,PRP,URF,URP,Sponge,CBC) stay unbounded under one unbounded statistical pseudometric $\Delta$ (reserving $\mathcal{D}$ strictly for computational hardness). - External usage limits ($\varphi_q$, $\varphi_{\sigma,\ell}$, $\varphi_{\mathrm{pf}}$, $\varphi_{\mathrm{nr}}$) are true endomorphism filter converters $\varphi : A \to A$ (made possible by sub-probabilistic non-response, without
A.withBot). Since $\varphi_q \cdot R$ and $\varphi_q \cdot S$ are silent past query $q$, $\Delta(\varphi_q \cdot R, \varphi_q \cdot S) = \Delta_q(\varphi_q \cdot R, \varphi_q \cdot S)$, and composition reduces to filter absorption ($\varphi_q \cdot \mathrm{CBC} \cdot \varphi_{bq} = \varphi_q \cdot \mathrm{CBC}$):
$$\varphi_q \cdot \mathrm{CBC} \cdot \mathbf{P} = \varphi_q \cdot \mathrm{CBC} \cdot (\varphi_{bq} \cdot \mathbf{P}) \approx_{\varepsilon_1} \varphi_q \cdot \mathrm{CBC} \cdot (\varphi_{bq} \cdot \mathbf{F}) = \varphi_q \cdot \mathrm{CBC} \cdot \mathbf{F} \approx_{\varepsilon_2} \varphi_q \cdot \mathbf{R}.$$
- Two-sided cumulative converters $P_\alpha$ and distinguishers in
Type 0:
DefineConverter A Bextensionally as a two-sided cumulative system $P_\alpha$ with Maurer's bilinear attachment $P_{\alpha R}(h_{\text{out}}) = \sum_{h_{\text{in}}} P_\alpha(h_{\text{out}}, h_{\text{in}}) \cdot P_R(h_{\text{in}})$ — natively probabilistic (noSeedInterface), automatically acting on correlatedSystem (B ⊗ C), giving≫associativity and⊗ₘinterchange by Fubini, and keeping any inductive query-tree /do-syntax strictly as an internal constructor. Distinguishers are dual cumulative systems inType 0. - Games as a predicate, not
TypedGame:
ReplaceTypedGamewith a[MonotoneMBO G]predicate onA.withMBO(Y' x := A.Y x × Bool), withG.visible = forgetMBO • GandliftMBOdefined uniformly on all converters.
Acceptance criteria
Execute via phased coexistence (Path 2) (~10–14 PRs, estimated −20K to −23K net LOC in constructive-cryptography and −8.5K to −11K LOC in downstream sequence-cc), gated on Phase 0:
- Phase 0 (Architectural Gate — 1 PR):
- Implement
Interface, sub-probabilistic cumulativeSystem A, two-sided cumulativeConverter A Bwith bilinear attachment, andMonoidalCategory+ResourceTheory+CompatiblePseudoMetricinstances forConstructiveCryptography. - Prove the
MonoidalCategoryinterchange law(α ▷ D) ≫ (A ◁ β) = (B ◁ β) ≫ (α ▷ C)on correlatedSystem (B ⊗ D), verifycc_normalize/cc_calc/cc_constructwork unmodified, and verify CR18 endomorphism filter absorption (φ_q' ≫ α ≫ φ_q = φ_q' ≫ αandφ_q ≫ φ_q = φ_q).
- Implement
- Phase 1–2 (Core v2, Proof Engines & DSL):
- Provide
Coefor functions,ofStep/ProbAutomatonand internal tree/program constructors,MonotoneMBO+≡gFundamental Lemma,eagerURF = lazyURFbridge for[Fintype X], and non-dependentHist (eval X Y) ≃ List (X × Y)helpers. - Port
HCoefficient,RatioCost,RevealedHCoefficient,Coupling,UntilBad,SamplingDistance, and lightweightDSL/notation. - Verify end-to-end adaptive URF/URP switching
Δ (φ q • lazyURF X) (φ q • lazyURP X) ≤ q.choose 2 / |X|and CBC-MAC filter-absorption composition cleanly with zero axioms beyond[propext, Classical.choice, Quot.sound].
- Provide
- Phase 3–4 (Bridge, Flagship Pilots & v1 Retirement):
- Add
v2 → v1truncation bridge, portCommons/Definitions/(PRF,CollisionBound,LazyPermutation,Indifferentiability,Sponge), validate onsequence-cc(eliminatingWorkInterface,PublicPrimitive,PortRoutingbudgets,SeedInterface, andBoundedBytes), then retireRandomSystems/Typed/andRandomSystems/DDC/.
- Add
- 主要言語
- Lean
- スター
- 3
- フォーク
- 0
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 159
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
trailofbits/constructive-cryptography のほかの issue
-
needs-format
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
trailofbits/constructive-cryptography#471 ·
メンテナーはふだん 1 日以内に返信
-
Exclude all approximate ideal witnesses with separating tests対応中かも @MarcIlunga が 1 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
trailofbits/constructive-cryptography#449 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
trailofbits/constructive-cryptography#430 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
trailofbits/constructive-cryptography#429 ·
メンテナーはふだん 1 日以内に返信
-
Expose normalized and filtered transcript bounds through the selected distance対応中かも @MarcIlunga が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
trailofbits/constructive-cryptography#428 ·
メンテナーはふだん 1 日以内に返信
trailofbits/constructive-cryptography の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
lidofinance/validator-ejector#233 ·
メンテナーはふだん 1 日以内に返信
-
area/Driver_-_cpp-rs-driver bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
scylladb/cpp-rs-driver#542 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
latchset/kryoptic#600 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue priority:high track:crypto
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
`libcrux-aead` fails to compile when referenced with `default-features = false`対応中かも @jschneider-bensch が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信