Repository navigation
feat(s140): receipts v4, N6 statements in COSE_Sign1 - #138
Merged
Merged
Conversation
…gle-signer carrier, ESP384 in FIPS mode, statement_id links, subject and decision by digest; v2 and v3 still verify) 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 140. New receipts and checkpoints are N6 statements: deterministic CBOR inside COSE_Sign1, in the single-signer carrier, signed with ML-DSA-87 (-50), Ed25519 (-19) or, in FIPS mode, ECDSA P-384 as ESP384 (-51). Receipts written before keep their DSSE form and still verify, and a chain that began in v3 continues in v4.
What it does
Trinity.Receipts.V4).typand one schema number, provisional, in Trinity's block 0x83.subjectanddecisionare referenced by SHA-384 over their RFC 8785 bytes, which are stored beside the row and hashed as stored. No receipt carries a tool call's arguments or its result; those enter as the approval fingerprint and a digest.statement_id, the same whether or not the row is signed. The first v4 row after a v3 row links to SHA-384 over that row's PAE bytes.Trinity.N6.EC2).r || sand nothing else.sandn - sboth verify.kidis the RFC 9679 thumbprint over 107 bytes, each coordinate padded to 48.nssentry point.typno longer names an algorithm, as slice 139 had it: the key's registration does, and a header naming another algorithm isalg_not_permitted.typistyp_schema_mismatch; a signed body without an issuer isissuer_missing.schema_reserved,test_schema_outside_test_mode,unknown_schema.config :trinity, :receipts, profile: :commercial | :nss. Under:nss, any signer but ML-DSA-87 is refused at selection: a regulated boot then refuses to start, and a default one denies every effect.bin/verify_receipt.exsloads the N6 sources andTrinity.Receipts.V4from Trinity'slib/(or--n6) when it meets a v4 row, and runs the same rules. A v2 or v3 chain still needs nothing but OTP. The script loads thecryptoapplication first, because OTP 28.5.0.8 otherwise prints a warning into its output.body,carrier,subject_bytes,decision_bytes;bodyandcarrieron checkpoints). No v2 or v3 row is touched.xbegins with a zero byte) and the new refusal codes. Slice 139's twoalg_not_bound_to_typheader vectors are withdrawn, and its Ed25519 samples now carry an issuer.Evidence
mainbefore the change, a new row isreceipt_v3_ed25519; on this branch it is v4, with its body and carrier stored.fipsjob checks -51 rows in the mode. The ML-DSA-87 step writes -50 rows with thenssprofile and verifies them atnss, run locally on OTP 28.5.0.8 with OpenSSL 3.5.9.sha384sumrun outside Elixir.n - sverified 200 of 200 times on OpenSSL 3.0.13 and on 3.5.9.CI
fipsjob's mode-off ML-DSA-87 step now also runstest/trinity/receipts/v4_test.exsandtest/trinity/n6/esp384_test.exs.Not in this PR