Skip to content

spec(port): port the commit secret export collision guard (Refs #8883) - #9896

Closed
dmitrii-f-t27 wants to merge 2 commits into
gHashTag:masterfrom
dmitrii-f-t27:port/cr-chat-03-b
Closed

dmitrii-f-t27 wants to merge 2 commits into
gHashTag:masterfrom
dmitrii-f-t27:port/cr-chat-03-b

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

The second CR-CHAT-03 ring target (W3, tracker #8883, epic gHashTag/trios#1812): port of crates/trios-chat/rings/CR-CHAT-03/src/commit_secret_export_collision.rs (Wave-33, L-CHAT-3-csec, R-CHAT-11, RFC 9420 8.4/9).

After each Commit the deriving member exports a fresh commit secret from the KDF tree, bound to the group, the epoch and the commit transcript hash. A hostile member splices across groups or epochs, replays a published secret, binds to a phantom transcript or submits the zero sentinel; a single deny wins. Rules, in the original's fixed order:

  1. canonical secret length (32),
  2. non-empty transcript hash,
  3. transcript present in the local ledger,
  4. group_id == expected_group_id,
  5. commit_epoch == current_epoch,
  6. (transcript_hash, commit_secret) pair fresh against every prior export,
  7. commit_secret not the all-zero sentinel.

Carried as the D5 verdict — all seven original error variants carry no payload, so the code is the whole verdict.

Adaptations (t27 conventions): export/view structs → flat parameters, byte vectors as plain slices; the vector of known transcript hashes → slice of fixed-capacity records (64 bytes, the original's generous upper bound); the vector of exported pairs → slice of records holding transcript and secret with lengths; the original's Vec/tuple contains → scans. The known-hash record's length field is named hash_len — a field named len anywhere in the spec breaks gen-rust's slice-length lowering (the DMPE lesson, bitten again here).

All 10 original CSEC tests transcribed with exact asserts (CSEC-10 pins that the replay rule reads the pair, never the hash alone), plus 4 helper tests and a rule-order test stacking each earlier rule's violation on a later one (15 total).

Checks (conventions 0-14): t27b test 15 passed 0 failed, 0 blockers; t27c test-report 15/15, 0 vacuous; gen-rust output compiles under rustc (0 'static str, 0 Vec<const); coverage Untested 0; ASCII only; seal saved, all hashes MATCH; ledger row added to docs/reports/t27b_expectations.json.

Refs #8883

…Tag#8883)

The second CR-CHAT-03 ring target (W3, L-CHAT-3-csec,
R-CHAT-11, RFC 9420 8.4/9): the commit-secret export rules,
in the original's fixed order - the canonical secret length
(thirty-two), the non-empty transcript hash, the transcript
present in the local ledger, the group equal to the expected
one, the epoch equal to the current one, the (transcript,
secret) pair fresh against every prior export, and the
secret not the all-zero sentinel - as the D5 verdict (all
seven original variants carry no payload, so the code is the
whole verdict), the original's rule order, and all ten CSEC
tests transcribed plus helper and rule-order tests.

The original's export and view structs become flat
parameters, the byte vectors arriving as plain slices. The
vector of known transcript hashes becomes a slice of
fixed-capacity records (sixty-four bytes, the original's
generous upper bound), and the vector of exported pairs a
slice of records holding the transcript and the secret with
their lengths - the original's Vec and tuple contains become
scans. The known-hash record's length field is named
hash_len: a field named len anywhere in the spec breaks
gen-rust's slice-length lowering (the DMPE lesson, bitten
again here).

Checks (conventions 0-14): t27b test 15 passed 0 failed; t27c
test-report 15/15, 0 vacuous; gen-rust output compiles under rustc;
coverage Untested 0; ASCII only; seal saved, all hashes MATCH;
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

All required checks green (validate, check-linked-issue, parse-ratchet, t27b-native-linux, t27b-native-macos); cli-tri / duplicate-bodies / t27b-native-ratchet are the known non-required reds. Steward READY. Second CR-CHAT-03 target (2/47 T-PORT) — requesting owner merge when convenient, Refs #8883.

This was referenced Oct 17, 2026
This was referenced Oct 17, 2026
# Conflicts:
#	docs/reports/t27b_expectations.json
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

Superseded by #10175: the remaining CR-CHAT targets now land as one port-wave batch per specs/policy/pr_budget.t27 (#10067/#10074), which asks for one PR per ring batch instead of one per file. The spec body, seal and ledger row in this PR are unchanged there; the batch also carries one self-consistent duplicate-body bless. Closing this one-file PR keeps the merge queue and the Actions queue small.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant