Repository navigation
feat(s139): complete slice 139 (the N6 single-signer carrier, Ed25519 on commercial; the receipt verifier answers in FIPS mode) - #135
Merged
Conversation
… on commercial; the receipt verifier answers in FIPS mode) Signed-off-by: Ayla Croft <aylacroft@proton.me>
…the body test does not depend on load order Signed-off-by: Ayla Croft <aylacroft@proton.me>
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.
Slice 139. Two additions to the N6 layer that a single signer needs, and a fix for receipt verification on a runtime that refuses a row's algorithm. Nothing Trinity signs changes: no receipt, checkpoint or fingerprint covers different bytes after this PR.
The N6 additions follow the profile publisher's answers of 2026-10-19 to questions on draft r3. A later draft will carry those answers, so both additions are provisional, like the rest of the layer.
What it does
Trinity.N6.Carrier).{0: SINGLE_SCHEMA, 1: payload, 2: [protected, {}, nil, signature]}. The Sign1 is untagged and its payload is detached, the form the twin envelope uses for each of its two signatures.typwhose profile entry needs two signers is refused before its signature is checked (wrong_carrier_for_typ). Each half of a twin is a valid single signature on its own, so accepting one would accept half a statement as the whole.SINGLE_SCHEMAis a placeholder, 0xFFFF0003, until the profile assigns the number (Trinity.N6.Profile.schemas/0).commercialprofile (Trinity.N6.COSE).:nss(the default) or:commercial. Only:commercialadmits -19.typto its one algorithm, and a header with any other algorithm is refused.{1: 1, -1: 6, -2: x}), which do not include the algorithm. So a verifier takes each key together with the algorithm it was registered under, and that must match the header's.:crypto. FIPS mode refuses Ed25519, and there both answer "no trust" (exit 5), not a crash.:crypto.verifyraise. The verify task, the receipts page, a chain merge,bin/verify_receipt.exs, and a chain writer starting over such a checkpoint all crashed.:cryptoraises the same error shapes for a registered public key it cannot use. So the verifier first asks whether the runtime does the algorithm at all, and only then says whether the algorithm or the key was the problem (Trinity.Receipts.Signer.check/4).Vectors
The candidate vector set gains:
cose/sign1/layout, each with its.expectand a.ctx.jsonnaming the entry point and keys.The signed sample is Ed25519, which is deterministic, so its signature is a literal: the generator runs where Ed25519 is refused, and the suite checks that signing reproduces the literal wherever Ed25519 is available. The set is now 384 files, 86,749 bytes. The SHA-384 of
SHA384SUMSis14c666b3efcc9586782d4dbf0205ede7321f32b804313ef02d8415dcf5601230b201f64a96c90f7dfb68085b28257518.test/fixtures/receipts/holds exported chains signed under published test keys, with Ed25519 and with ML-DSA-87 (scripts/receipt_foreign_chains.exs).Evidence
Verifier.verify/2raisedbadarg"Bad digest type" on both ML-DSA-87 chains, and starting the chain writer returned the same exception as its error. After the fix: exit 5,alg_unavailable.bin/verify_receipt.exsgives the same exit as the in-app verifier on every chain, and on one with a malformed key.typto its algorithm;nss;typadmitted in the carrier;sha384sumovera3 01 01 20 06 21 58 20followed by the 32 key bytes gives the vector'skid.CI
The
fipsjob's mode-off step also runs the new receipt-chain tests, since that step is the only place in CI where ML-DSA-87 verifies. In FIPS mode, and on the gate runners, those tests take the no-trust branch, and each run prints which branch it took.Not in this PR
statement_idfor single signers, the twin envelope, the note form and the hash envelope.