π Wave-19: KEM decapsulation oracle + tag-stripping#719
Merged
Conversation
L-CHAT-8-decap (CR-CHAT-01): ML-KEM-768 decapsulation oracle observer
- DecapObservation::{MatchedReference, DifferedFromReference, Errored}
- constant-time ss_eq, observe() never returns SS
- 10 unit tests (DEC-01..06 + 4 bonus)
- Routed to CR-CHAT-01 (kem.rs lives there) preserving L-ARCH-001
L-CHAT-9-tagsplit (CR-CHAT-06): structured-output tag-stripping
- SpanTag/TagSplit/Span + parse/serialise
- 10 unit tests (TAG-01..06 + 4 bonus)
Coq Section TrinityChatWave19: INV-CHAT-103..109 + 2 helpers
- 9 new Qed β 148 Qed total, 0 Admitted, 0 new axioms
Falsifier 1700 β 1800 (36 cats @ 100%, all G-C10 thresholds met)
DENY_PATTERNS extended with W19 keyword block (~260 patterns)
ROADMAP updated: status W19, anchor extended
Closes #718
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #718
π Trinity Chat Wave-19 β KEM decapsulation oracle + structured-output tag-stripping
Parent EPIC: trinity-fpga#28
Predecessor: #717 (W18 β merged
6902a82)Anchor:
ΟΒ² + Οβ»Β² = 3 Β· β¦ Β· PADDING-CLASS-ORACLE Β· JITTER-SIDE-CHANNEL Β· KEM-DECAP-ORACLE Β· TAG-STRIPPINGThreat lanes (Γ2)
Lane A β L-CHAT-8-decap (R-CHAT-2 / CR-CHAT-01)
crates/trios-chat/rings/CR-CHAT-01/src/kem_decap_oracle.rs(285 lines)DecapObservation::{MatchedReference, DifferedFromReference, Errored}ss_eq()β constant-timesubtle::ConstantTimeEqobserve()β never returns the shared secret, only an opaque enumKEM_DECAP_ORACLE_CT_LEN = MLKEM768_CT_LEN,KEM_DECAP_ORACLE_SS_LEN = MLKEM768_SS_LENRouting note (R5 honesty): ML-KEM-768 keypair,
encapsulate_to, and CT/SS types live in CR-CHAT-01 (kem.rs), not in CR-CHAT-02 as the W18 ROADMAP plan suggested. Placing the oracle observer in CR-CHAT-01 avoids cross-ring leaks ofkem.rsinternals (preserves L-ARCH-001).DifferedFromReference(ek, ct)-boundss_eqis constant-time (no early-exit oracle)observe()never returns SS β only opaque enum variantsLane B β L-CHAT-9-tagsplit (R-CHAT-12 / CR-CHAT-06)
crates/trios-chat/rings/CR-CHAT-06/src/tag_stripping.rs(380 lines)SpanTag::{Trusted, Untrusted}TagSplit::{Unbalanced, NestedNotAllowed, UnknownTag, TagInPayload, EmptyInput, EmptyPayload, StrayBytes}Span{tag, payload},parse_structured_output(),serialise_structured_output()<TRUSTED>β¦</TRUSTED>/<UNTRUSTED>β¦</UNTRUSTED>onlyUnbalancedNestedNotAllowed(flat sequence only)<SYSTEM>,<TRUST>,<TRUSTED foo>) βUnknownTagTagInPayloadEmptyInput; empty payload βEmptyPayloadStrayBytesCoq Wave-19 β
Section TrinityChatWave19INV-CHAT-103..109 + 2 helpers (
nested_check_passes19,well_formed_span_passes19) β 9 newQed.β 148 Qed total, 0 Admitted, 0 new axioms.Cumulative axiom set unchanged at 5:
ss_kp_injective(W9),dh_step_fresh+dh_post_history_independent+hybrid_kem_non_degenerate(W10),sn_hash_sym(W14).Falsifier 1700 β 1800
corpus/prompt_injection.jsonl: +50PI-DEC-001..050+ +50PI-TAG-001..050falsifier_runner.rs: +2 threshold lanes (kem_decap_oracle,tag_stripping) at 0.95injection.rs::DENY_PATTERNS: +260 keywords covering FO-rejection distinguishability + tag-stripping languageVerification gauntlet (all green)
cargo test(12 chat crates)e2e_chat_25falsifier_runnercargo clippy --all-targets -- -D warningscoqc Trinity_Chat.vunsafeblocksWave progression
047f3cb6902a82Honesty tags (Art. I + R5)
[VERIFIED]by cargo /grep -cEkem_decap_oracleto CR-CHAT-01 (not CR-CHAT-02):[DERIVED]fromkem.rslocation[VERIFIED]in ROADMAP.md[ASPIRATIONAL]Compliance
.shfilesCloses #718(Laws Guard regex green)rings/CR-CHAT-NN/[VERIFIED]from CI gates