RFC: Budget-free dependent Interface, cumulative CR18 Systems/Converters, and endomorphism Filters
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 12/100
- Type d'issue
- Refactorisation
- Clarté
- À clarifier
- Activité
- Active
- Domaine
- cryptography
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Lean
- Étoiles
- 3
- Forks
- 0
- Merge moyen
- 1 j 2 h
- PR mergées (30 j)
- 159
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de trailofbits/constructive-cryptography
-
needs-format
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 12/100
trailofbits/constructive-cryptography#471 ·
Les mainteneurs répondent en général sous 1 jour
-
Exclude all approximate ideal witnesses with separating testsPeut-être pris @MarcIlunga l’a pris il y a 1 jour. Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
trailofbits/constructive-cryptography#449 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 12/100
trailofbits/constructive-cryptography#430 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
trailofbits/constructive-cryptography#429 ·
Les mainteneurs répondent en général sous 1 jour
-
Expose normalized and filtered transcript bounds through the selected distancePeut-être pris @MarcIlunga l’a pris il y a 1 jour. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 18/100
trailofbits/constructive-cryptography#428 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de trailofbits/constructive-cryptography
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
lidofinance/validator-ejector#233 ·
Les mainteneurs répondent en général sous 1 jour
-
area/Driver_-_cpp-rs-driver bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
scylladb/cpp-rs-driver#542 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
latchset/kryoptic#600 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
good first issue priority:high track:crypto
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
-
`libcrux-aead` fails to compile when referenced with `default-features = false`Peut-être pris @jschneider-bensch l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour