diff --git a/AGENTS.md b/AGENTS.md index 1deab7d..90a19e1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,7 +38,9 @@ the first build, SDK or sealed file that reaches somebody else. `CHANGELOG.md` i - `reviews/` — historical review notes (cryptographic, implementability). Findings are graded BLOCKING / SHOULD / NOTE; the spec absorbed them and is authoritative. Do not update a review to match the spec. A `design-*.md` - note there is a proposal the spec has not adopted (§11 points at it). + note there is a proposal; its status line says whether the spec adopted it + (`design-clip-timing.md` is, since corpus 7.0.0) and §11 points at the ones + still open. - `schema/` — JSON Schema plus a validator runnable from CI, including the shape of a published conformance report. - `vectors/` — one directory per case, each with the input, the proof and the @@ -47,7 +49,10 @@ the first build, SDK or sealed file that reaches somebody else. `CHANGELOG.md` i written from the spec to prove the vectors consistent; it is not the implementation others copy. When it disagrees with an expected verdict, the review decides which one is wrong — the generator refuses to write a vector - the verifier fails. The C2PA carrier reader (`jumbf.ts`, `cbor.ts`, + the verifier fails. One file is meant to be ported: `timing.ts`, the §5 + *Timing* record, its hash and root, the timescale conversion and the + media-edit rule, which the sealers and verifiers implement from it and from + vector 175's `debug` records. The C2PA carrier reader (`jumbf.ts`, `cbor.ts`, `carrier.ts`) reads structure only and has no dependency; the vectors with real Content Credentials (123–147, 169–171) are minted on demand by `make-c2pa-vectors.ts` through `@contentauth/c2pa-node`, a devDependency @@ -81,7 +86,7 @@ Node 22 (`.nvmrc`), from `tools/`. CI (`.github/workflows/ci.yml`) runs, in orde ``` npm ci npm run typecheck -npm test # vitest: vectors, vault, watermark layouts, conformance docs vs corpus +npm test # vitest: vectors, vault, watermark layouts, timing record, conformance docs vs corpus npm run validate # every vector's proof.json / expected.json against the schema npm run manifest:check # vectors/MANIFEST.json matches vectors/ npm run conformance:check # conformance report: corpus version, manifest hash, vector count diff --git a/CHANGELOG.md b/CHANGELOG.md index d1b0f20..9c57646 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,94 @@ else. ## Unreleased +### A clip's timing is bound — corpus 6.2.0 → **7.0.0** + +**Breaking.** §5 *Timing* (new), §5 *Presentation*, §6.1, §7, §8: a video +proof's core gains a **required** field, `media.timing` +`{ video_timescale, audio_timescale, root }`, and every `segments[]` entry a +**required** member, `timing`. Absent or malformed → the proof is not well +formed: **no proof found**, as for `media.presentation` (vectors 176, 187). +The design is `reviews/design-clip-timing.md`, accepted 4 October 2026. + +Before: a segment's `content_hash` covers NAL units and audio frame bytes and +`media.presentation` how a player is told to show them; nothing covered +**when**. For an original `media.hash` covers every timing table; for a clip +a re-mux that kept every sample could freeze a frame (`stts`), reorder frames +inside a GOP (`ctts`), rescale both tracks in sync (`mdhd`), trim inside a +located segment (the media edit) or declare another audio sample rate +(`esds`), and still read *verified clip*. No verifier-only rule could close +it: no signed byte carried a duration. + +- **The record.** `timing(n) = uint32 v ‖ (int64 dts_i − dts_0 ‖ int64 + cts_i) × v ‖ uint64 end_n − dts_0 ‖ uint32 a ‖ (int64 adts_j − adts_0 ‖ + uint32 adur_j) × a`, big-endian: the segment's video samples in decode + order, their composition offsets (0 without `ctts`), the last sample's DTS + plus its own duration, and the audio frames §5 already assigns to the + segment by DTS, every value in its own track's `mdhd` timescale as the file + states it. `segments[n].timing = SHA-256(timing(n))`; `media.timing.root = + SHA-256(timing hash 0 ‖ … ‖ timing hash segment_count − 1)`; + `audio_timescale` is absent on a file without an audio track. The 96-byte + segment message does not change, so no segment is re-signed: the sealer + reads the record back from the finished file, as it already does for + `media.presentation`, and signs the core after. +- **The verifier.** With every entry present it recomputes the root from the + entries: a mismatch is **tampered** (vector 177). On a file that is not the + original, each located segment's record is read back and converted into + the signed timescales, `t_signed = t_received × ts_signed / ts_received`, + which must be an integer for every value; a record that does not hash to + its entry, a proof that lacks an entry (so the root cannot authenticate + any), or a single media edit that trims inside a located segment (one movie + tick of slack at the end) → **frames not compared**, new label **timing + differs**, no segment credited — amber, never red. On an original, a root + the file's own records do not reproduce is the writer's false claim: + *authentic* with *timing differs*, capped amber (vector 185). The audio + sample entry's `esds` joins `X` in `media.presentation.config`, so a + changed sample rate is *presentation differs* (vector 183). +- **Reference.** `tools/src/timing.ts` (record, hash, root, timescale + conversion, edit rule) and `tools/src/container.ts` (the values per GOP, + `ctts`, the media edit, the `esds`); `tools/src/remux.ts` can now rescale a + track, retime samples and write a `ctts`. + +Corpus 7.0.0 (187 vectors). No backward compatibility: the device captures 36, +37, 48 and 85 keep their bytes and their *no proof found*. + +- **Moved bytes, re-signed, verdicts unchanged**: 33, 38, 39, 86–94, 156, + 158–163, 165–168 and 173 (`npm run generate`), each core and segment chain + re-signed with the test key with `media.timing` and the entries' `timing` + read back from the container (33 and 165 carry synthetic timing hashes, as + they carry synthetic content hashes); 143–147 and 171 minted again by + `make-c2pa-vectors.ts --only 143,144,145,146,147,171` (new salts; notes + record c2patool 0.27.16). **No existing verdict moved**: every re-muxed + clip in the corpus keeps its timescales and durations. 158's note is + corrected in place (its `colr`). +- **New**: 175 (vector 166 with every `timing(n)` in `debug` → *authentic*), + 176 (core without `media.timing` → *no proof found*), 177 (an entry's + `timing` not in the root → *tampered*), 178 (166 cut at the end → *verified + clip* 0–1), 179 (a frame frozen → *frames not compared*, *timing + differs*), 180 (two frames reordered by `ctts` → the same), 181 (both + timescales doubled, durations kept → the same), 182 (timescales and every + duration ×2 → *verified clip* 1–2), 183 (`esds` 48 → 44.1 kHz → *frames not + compared*, *presentation differs*), 184 (media edit ends inside segment 2 + → *timing differs*), 185 (an original signed in microseconds → *authentic*, + *timing differs*), 186 (89's clip with entry 0 dropped from the proof → + *timing differs*), 187 (an entry without `timing` → *no proof found*). + +**What a verifier that predates 7.0.0 does** (measured with the 6.2.0 +reference verifier): it has not learned the new fields are required, so 176 +and 187 read *authentic*, and it does not recompute the root, so 177 does +too. On every file with an audio track it builds `config` without the `esds` +the core now covers, so the originals of vector 166's family (166, 175–177, +185, 187) read *authentic* with *presentation differs*, and every clip of it +(89, 171, 173, 178–184, 186) *frames not compared*, *presentation differs* — +89, 173, 178 and 182 included, which are *verified clip*; 145 reads *no +proof found* (depth 1). The silent files (158–163, 167, 168, 94) read as +before. It fails the `core_hash` of every moved vector. + +`threat-model.md` §5.1 *Clip re-timed* is closed; still open, and recorded in +§11: a media edit that runs past the end of the track, the audio sample +entry's own fields beside the `esds`, and an `esds` inside a QuickTime `wave` +box, which no vector exercises. + ### An appended trailer no longer accuses a file with a genuine sidecar — corpus 6.1.0 → **6.2.0** **Breaking** for verifiers (a reading rule changed), not for the corpus: no diff --git a/README.md b/README.md index 2ddc5df..9a48304 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ spec/ the specification document (normative), the watermark payload measured), the C2PA interoperability and sidecar companion (informative, with the writer rules it pins) and the public threat model reviews/ review notes on the draft (crypto, implementability); the spec absorbs them and cites - their measurements, they stay as the record of why; design-*.md are proposals not yet adopted + their measurements, they stay as the record of why; design-*.md are proposals, each with its status schema/ JSON Schema of the proof + validator vectors/ conformance vectors: sealed files, broken signatures, edge cases (see vectors/README.md), the versioned corpus manifest and how to claim conformance against it (vectors/CONFORMANCE.md) tools/ reference tooling (Node 22, TypeScript): JCS, trailer, canonical bytes, core signature, - segment chain, the C2PA carrier reader, the vector generators and the reference + segment chain, the segment timing record (timing.ts, written to be ported), the C2PA carrier reader, the vector generators and the reference verifier CI runs over vectors/, plus corpus-drift.sh, which a consumer that pins this repository as a submodule runs from its own suite to learn whether its pin has fallen behind main diff --git a/reviews/design-clip-timing.md b/reviews/design-clip-timing.md index ea7a45c..1be6b54 100644 --- a/reviews/design-clip-timing.md +++ b/reviews/design-clip-timing.md @@ -1,11 +1,21 @@ # Design note — binding a clip's timing -Status: **proposal**, 3 October 2026. Nothing here is normative; the format -does not change until this is accepted, specified in `vcap-proof-1.0.md` §5 -and §6.1, and given its vectors. Written because an audit found that a clip -can be re-timed and still read *verified clip*, and asked whether a -verifier-only rule could close it. It cannot; this note says why and what the -sealers would have to sign. +Status: **accepted** 4 October 2026, **implemented** in corpus 7.0.0: +`vcap-proof-1.0.md` §5 *Timing* and §6.1 `media.timing` are normative, and +vectors 175–187 pin them. Proposed 3 October 2026. The text below is the +proposal as accepted and is not normative; where the spec settles a detail, +the spec is authoritative. What the spec settled beyond this note: `end_n` is +always the last sample's DTS plus its duration (equal to the next IDR's DTS +in a sample table, and never the `mdhd` duration); `audio_timescale` is +absent — never `null` or 0 — on a file without an audio track; the root is +recomputed only when every entry is present, and a clip whose proof lacks one +reads *timing differs* (vector 186); an entry without `timing` is not well +formed (vector 187); the media edit rule gives one movie tick of slack at the +end and applies to clips only; vector 4 below became an end cut (178), +because vector 89 itself now carries the timing-kept case. Written because an +audit found that a clip can be re-timed and still read *verified clip*, and +asked whether a verifier-only rule could close it. It cannot; this note says +why and what the sealers would have to sign. ## The gap diff --git a/schema/README.md b/schema/README.md index 1bb9de3..9dbf77a 100644 --- a/schema/README.md +++ b/schema/README.md @@ -12,8 +12,9 @@ What it pins, beyond types: base64url lengths (16-byte ids, 32-byte hashes, core, enum values of `platform`, `secure_hw`, `layout`, `level`, `source`, `verdict`, `location_corroboration.result`, `additionalProperties: false` inside every known object (`location_corroboration` included), and -`media.segment_count` and `media.presentation` required whenever `segments` -is present — which a video proof (`media.mime` `video/…`) always is. +`media.segment_count`, `media.presentation` and `media.timing` required +whenever `segments` is present — which a video proof (`media.mime` +`video/…`) always is — with `timing` required in every `segments[]` entry. `expected.schema.json` is the shape of a vector's `expected.json`. @@ -28,17 +29,18 @@ npm run validate -- path/to/proof.json [more.json …] # exit 1 on the first Without arguments, `npm run validate` walks `vectors/`: every `expected.json` must be well formed, and every `proof.json` must be schema-valid exactly when -its vector says so (`schema_valid`). Eleven vectors are schema-invalid on +its vector says so (`schema_valid`). Thirteen vectors are schema-invalid on purpose — DER signature (13), major 2 (16), missing `capture_id` (21), a float in the core (22), a video proof without `segments` (34), an unknown `secure_hw` (40), missing `media.w`/`media.h` (46), an `integrity.verdict` outside the enumeration (67), a `location_corroboration.result` outside it (80), an unknown `location.level` (83), a video proof without -`media.presentation` (165) — and the generator refuses to write a vector -whose review verdict and schema verdict disagree. Seven more are +`media.presentation` (165), one without `media.timing` (176), a segment entry +without `timing` (187) — and the generator refuses to write a vector +whose review verdict and schema verdict disagree. Four more are schema-invalid because the format moved under them: the device captures 36, -37, 48 and 85 and the C2PA vectors 145–147 that carry 36's proof predate -`media.presentation` and cannot be re-signed (`vectors/README.md`, *Errata*). +37, 48 and 85 predate `media.presentation` and `media.timing` and cannot be +re-signed (`vectors/README.md`, *Errata*). Programmatic use: `validateProof(json)` in `tools/src/schema.ts` returns `{ valid, errors }` with JSON pointers and messages, never values. diff --git a/schema/vcap-proof-1.0.schema.json b/schema/vcap-proof-1.0.schema.json index a168f37..a8114a1 100644 --- a/schema/vcap-proof-1.0.schema.json +++ b/schema/vcap-proof-1.0.schema.json @@ -68,7 +68,7 @@ "properties": { "config": { "$ref": "#/$defs/bytes32", - "description": "SHA-256 of the presentation message: the decoder configuration's parameter sets, then clap, pasp and colr" + "description": "SHA-256 of the presentation message: the decoder configuration's parameter sets, then clap, pasp and colr, then the audio sample entry's esds" }, "matrix": { "type": "array", @@ -91,6 +91,33 @@ "description": "the video tkhd width and height, 16.16 fixed point as stored" } } + }, + "timing": { + "type": "object", + "additionalProperties": false, + "required": [ + "video_timescale", + "root" + ], + "description": "§5 Timing, required wherever segments are (so of every video proof): the root of the segments' timing hashes, so a clip cannot be re-timed, reordered or rescaled", + "properties": { + "video_timescale": { + "type": "integer", + "minimum": 1, + "maximum": 4294967295, + "description": "the video track's mdhd timescale as the sealer wrote it" + }, + "audio_timescale": { + "type": "integer", + "minimum": 1, + "maximum": 4294967295, + "description": "the audio track's mdhd timescale as the sealer wrote it; absent, never null or 0, when the sealed file has no audio track" + }, + "root": { + "$ref": "#/$defs/bytes32", + "description": "SHA-256 over segments[0..segment_count-1].timing, 32 bytes each, in index order" + } + } } } }, @@ -268,7 +295,8 @@ "gop", "hash", "prev", - "sig" + "sig", + "timing" ], "properties": { "gop": { @@ -293,6 +321,10 @@ }, "sig": { "$ref": "#/$defs/p1363" + }, + "timing": { + "$ref": "#/$defs/bytes32", + "description": "SHA-256 of timing(n), the segment's timing record (§5 Timing); bound by media.timing.root" } } } @@ -655,7 +687,8 @@ "type": "object", "required": [ "segment_count", - "presentation" + "presentation", + "timing" ] } } @@ -692,7 +725,8 @@ "type": "object", "required": [ "segment_count", - "presentation" + "presentation", + "timing" ] } } diff --git a/spec/c2pa-interop-1.0.md b/spec/c2pa-interop-1.0.md index ae44978..d646921 100644 --- a/spec/c2pa-interop-1.0.md +++ b/spec/c2pa-interop-1.0.md @@ -165,6 +165,7 @@ the writer's side. |---|---|---| | `media.hash`, canonical bytes (§4.1) | `c2pa.hash.data` (18.5), `c2pa.hash.boxes` (18.7), `c2pa.hash.bmff.v3` (18.6) | same purpose, **different coverage**: vcap excludes the trailer and, on JPEG, the C2PA store's JUMBF APP11 segments; C2PA excludes its own manifest store and whatever its exclusion list names. Neither hash is derivable from the other; each side recomputes its own | | `segments[]` (§5) | `c2pa.hash.bmff.v3` with `merkle` over `mdat` chunks (18.6) | both hash pieces of the media; C2PA's tree proves a chunk belongs to the signed whole, vcap's chain proves order, completeness and where a cut was made. A C2PA Merkle proof is not a clip verdict | +| `media.presentation`, `media.timing` and each entry's `timing` (§5 *Presentation*, *Timing*) | `c2pa.hash.bmff.v3` covers `moov` — sample entries, track headers, `stts`, `ctts`, `mdhd`, `elst` — of the asset it signs | vcap binds how and when the signed frames are shown **for every clip cut from the original**, in the core signed once; C2PA's BMFF hash binds them for the one asset a manifest signs, and a cutter's new manifest vouches for the clip's new tables, not for their agreement with the source | | `capture_id`, `watermark.layout`, `watermark.mark_id` | `c2pa.soft-binding` (18.10): `alg`, `blocks`, `scope`, `bindingMetadata` | see §2.3 | | `sig` (ES256 over `JCS(core)`, §4.2) | claim signature: COSE_Sign1 over the claim, detached payload (10.3.2.4 *Signing a Claim*, 13.2.2 *Use of COSE*) | **never the same key.** The device key has an attestation chain, not a certificate meeting 14.5.1; a C2PA signer's certificate names an entity, not a piece of hardware. The proof rides inside the manifest; its signature is checked by a vcap verifier, the manifest's by a C2PA one | | `device.platform`, `device.secure_hw`, `device.key_id` | — | no equivalent: C2PA has no notion of the signer's hardware. This is the part the custom assertion adds | @@ -456,7 +457,7 @@ canonical bytes. | EXIF/XMP/APPn stripped or rewritten, pixels intact | kept | lost | — | kept | *tampered* (§8: photo hash mismatch, valid `sig`) | *tampered* | 04, 71 | | Re-encode by a platform (recompressed, resized, every header dropped) | lost | lost | lost | survives within the layout's budget | *no proof found*; with a detector: *origin traced*, *watermark matched* | *tampered*; with a detector the same *origin traced* | 71 (header), layouts doc (mark) | | Crop, rotate, filter, screenshot, re-photograph | lost | lost | lost | `photo-bch-v3` may decode within its budget; beyond it *watermark not recovered* | *no proof found* → at most *origin traced* | *tampered* → at most *origin traced* | — | -| Video trimmed or remuxed without re-encoding (NAL units and vcap SEIs intact) | lost | — | lost or kept | kept | *no proof found* | *verified clip*, amber: `media.hash` differs, the segments still in the file are located and verify, the chain says where it was cut (§5) | 89 for the embedded case; the sidecar case is in `vectors/README.md`, *Not here yet* | +| Video trimmed or remuxed without re-encoding (NAL units and vcap SEIs intact) | lost | — | lost or kept | kept | *no proof found* | *verified clip*, amber: `media.hash` differs, the segments still in the file are located and verify, under the signed presentation and timing, and the chain says where it was cut (§5); a re-mux that re-times them is *frames not compared*, *timing differs* | 89 and 178–186 for the embedded case; the sidecar case is in `vectors/README.md`, *Not here yet* | | Video re-encoded | lost | lost | lost | `video-rep-v1` usually survives | *no proof found* → *origin traced* | *frames not compared* when no GOP keeps a vcap SEI naming the capture (§5, *Locating segments*): the signature layer holds, nothing ties the frames to it; *tampered* when SEIs survive over re-encoded bytes | 86, 87 | | Photo edited by a C2PA-aware editor that keeps the source's Content Credentials | lost | — | new manifest, the source's as `parentOf` | may survive | *no proof found*, *Content Credentials carry the proof of a source capture* (§3.2, depth 1) | *tampered*: the sidecar is presented as this file's proof | 129, 130 | | Video trimmed by a C2PA-aware cutter, no re-encoding, the source's proof in its manifest | lost | — | new manifest, the source's as `parentOf` | kept | *verified clip*, through the chain | *verified clip* | 145 | diff --git a/spec/threat-model.md b/spec/threat-model.md index b352d45..16cb607 100644 --- a/spec/threat-model.md +++ b/spec/threat-model.md @@ -125,9 +125,9 @@ Boundaries, each enforced by code and tested: | Pixel or metadata edit | changes bytes after sealing | `media.hash` over canonical bytes, in the signed core (§4) | none: red | | Claim edit | changes location, time, level, capture id in the JSON | the core is signed (§4.2); `key_id` derived from `sig.pub`; proven level from attestation, claimed level capped | none: red / flagged | | Signature swap | re-signs the file with own key and attaches a genuine attestation chain | attestation leaf SPKI must equal `sig.pub` (§6.2) | none: red | -| Presentation edit | re-muxes a genuine clip keeping every sample, and rotates the track matrix, edits the out-of-band SPS (crop, colour) or adds an enabled track | `media.presentation` in the core binds the configuration record, `clap`/`pasp`/`colr`, the `tkhd` matrix and display size; the track layout rule (§5 *Presentation*, vectors 160–162) | none: *frames not compared*, never *verified clip*; a video proof without the field is not well formed, *no proof found* over the original and every clip (vector 165) | +| Presentation edit | re-muxes a genuine clip keeping every sample, and rotates the track matrix, edits the out-of-band SPS (crop, colour) or adds an enabled track | `media.presentation` in the core binds the configuration record, `clap`/`pasp`/`colr` and the audio `esds`, the `tkhd` matrix and display size; the track layout rule (§5 *Presentation*, vectors 160–162) | none: *frames not compared*, never *verified clip*; a video proof without the field is not well formed, *no proof found* over the original and every clip (vector 165) | | Timeline edit | re-muxes a genuine video with an edit list that trims, repeats or reorders what a player shows, every sample untouched | an edit list with more than one edit after the leading delay, or a rate change, is a timeline §5 does not model: no segment is located (§5, vector 156) | none: *frames not compared*, never *verified clip*; an original is covered whole by `media.hash` | -| Clip re-timed | re-muxes a genuine clip keeping every sample and the single-edit timeline, and changes sample durations (`stts`), composition offsets (`ctts`), the `mdhd` timescales or the audio sample rate: a frame frozen, a passage slowed, frames reordered within a GOP | none for a clip: no signed byte carries timing; audio assignment by DTS breaks the hashes only when a change moves an IDR relative to the audio | **open**: such a clip reads *verified clip*. An original is covered by `media.hash`. A proposal is in `reviews/design-clip-timing.md` | +| Clip re-timed | re-muxes a genuine clip keeping every sample and the single-edit timeline, and changes sample durations (`stts`), composition offsets (`ctts`), the `mdhd` timescales, the media edit's extent or the audio sample rate: a frame frozen, a passage slowed, the whole clip sped up in sync, frames reordered within a GOP, part of a segment hidden | each `segments[]` entry carries the hash of its segment's timing record, bound by `media.timing.root` in the signed core; a verifier reads each located segment's record back, converts it to the signed timescales exactly, and refuses a media edit that trims inside a located segment; the audio `esds` is part of `media.presentation` (`vcap-proof-1.0.md` §5 *Timing*, vectors 179–186) | none: *frames not compared* with *timing differs* (*presentation differs* for the sample rate), never *verified clip*; a forged entry hash is *tampered* (vector 177). Accepted: the audio–video offset is bound only to within one audio frame (the assignment rule's slack), and a media edit that runs past the end of the media — what a player shows there is not defined — is not bound. An original is covered by `media.hash` | | Proof transplant | moves a genuine trailer or sidecar onto another file | `media.hash` mismatch; on video, a signed segment counts only where a GOP of the received file names it and recomputes (§5, *Locating segments*) | none: red on a photo; *frames not compared* on a video whose GOPs name no segment of the proof, never *verified clip* | | Accusing trailer | strips a genuine file's trailer and appends another capture's valid trailer (CRC correct) beside the genuine sidecar, to have the file accused | beside a differing sidecar whose outcome is better over the same bytes, the sidecar decides, with *trailer copy differs* (`vcap-proof-1.0.md` §3.1, *A sidecar that does better*, vectors 172–173); ties keep the trailer (vector 174) | none with the sidecar present: the file reads as the sidecar says. Without it the appended proof decides, as it would on any file. **Open**: a footer whose CRC fails, or whose major is not 1, appended the same way still reads *corrupted proof* or *unsupported format version* whatever the sidecar says (§3.1 steps 2–3) | | Clip from a genuine video | cuts segments, keeps the trailer | per-segment chain over messages; `segment_count`; `media.hash` mismatch → *verified clip*, amber, ranges shown | accepted and **labelled**: a clip is a clip, never an original | diff --git a/spec/vcap-proof-1.0.md b/spec/vcap-proof-1.0.md index dd7de1e..4953583 100644 --- a/spec/vcap-proof-1.0.md +++ b/spec/vcap-proof-1.0.md @@ -675,8 +675,9 @@ sig(n) = ECDSA-P256-SHA256( message(n) ), P1363, low s (§4.2) and H.265 the SPS holds the cropping window and the VUI colour description, and every slice is decoded under the SPS and PPS it names), the track header's matrix (rotation, mirroring, translation) and display size, the - sample entry's `clap`, `pasp` and `colr` boxes, and which tracks a player may - enable. Parameter sets that travel in band, inside a sample, are NAL units + sample entry's `clap`, `pasp` and `colr` boxes, the audio sample entry's + `esds` (the sample rate and channel layout a decoder uses), and which tracks + a player may enable. Parameter sets that travel in band, inside a sample, are NAL units of that sample and already inside `content_hash`. For an original, `media.hash` covers all of it; for a clip, nothing did, so a re-mux that kept every sample could crop, rotate or re-describe the signed frames and @@ -696,9 +697,18 @@ sig(n) = ECDSA-P256-SHA256( message(n) ), P1363, low s (§4.2) ordered by `nal_unit_type` ascending (`nal[0] & 0x1f` in H.264, `(nal[0] >> 1) & 0x3f` in H.265), and NAL units of one type keep the order the record lists them in. `X` is the concatenation of every child box of - the sample entry whose type is `clap`, `pasp` or `colr`, each whole — - size, type and payload as stored — in file order; empty when there is - none. + the video sample entry whose type is `clap`, `pasp` or `colr`, each whole + — size, type and payload as stored — in file order, followed, when the + file has a `soun` track, by every `esds` box of that track's sample entry, + whole, in file order; empty when there is none of either. The child boxes + of an `mp4a` entry start 28 bytes into its payload (`SampleEntry`, then + the `AudioSampleEntry` fields); in a QuickTime sound description of + version 1 or 2 (the `uint16` 8 bytes into the payload) 16 or 36 bytes + later, and an `esds` inside a `wave` child of the entry counts as the + entry's. An audio sample entry of another type adds nothing. The + AudioSpecificConfig in the `esds` says the sample rate: change it and the + same coded frames play pitched and re-timed while every segment hash and + every timing record still match (vector 183). - **`matrix`** is the nine 32-bit values of the video track's `tkhd` matrix, each read as a signed big-endian integer, in stored order (`a, b, u, c, d, v, x, y, w`); **`display`** is the `tkhd` width and height, each read @@ -710,8 +720,9 @@ sig(n) = ECDSA-P256-SHA256( message(n) ), P1363, low s (§4.2) show any track that is enabled. A file that is not the original reaches *verified clip* only when the - layout holds and `config`, `matrix` and `display` read back equal the - signed ones (vectors 89, 94, 159). Otherwise the signed frames are in the + layout holds, `config`, `matrix` and `display` read back equal the + signed ones (vectors 89, 94, 159), and its timing reads back as signed + (*Timing*, below). Otherwise the signed frames are in the file under a presentation nobody signed: **frames not compared**, no segment credited, with *tracks not bound* when the layout does not hold (vector 162) and *presentation differs* when a value does not match @@ -749,6 +760,137 @@ sig(n) = ECDSA-P256-SHA256( message(n) ), P1363, low s (§4.2) extra track enabled, makes every clip of the file *tracks not bound*, and its original is still *authentic*. A writer MUST check its output against a verifier on a file it produced (vector 158 is one). +- **Timing.** A segment hash covers the bytes of the frames and + `media.presentation` how a player is told to show them; neither says + **when**. For an original `media.hash` covers the timing tables with every + other byte; for a clip nothing did, so a re-mux that kept every sample + could freeze a frame (`stts`), reorder the frames of a GOP (`ctts`), scale a + whole track or both (`mdhd`), or trim inside a located segment (the media + edit), and still read *verified clip*. The audio rule above binds timing + only by accident, where a change moves an IDR relative to the audio. The + sealer signs it instead, without touching the segment message: each + `segments[]` entry carries the hash of its segment's **timing record**, and + the core carries `media.timing`, whose `root` binds those hashes (§6.1). + + ``` + timing(n) = uint32 BE v + || ( int64 BE (dts_i − dts_0) || int64 BE cts_i ) × v + || uint64 BE (end_n − dts_0) + || uint32 BE a + || ( int64 BE (adts_j − adts_0) || uint32 BE adur_j ) × a + + i = 0 … v−1 the video samples of segment n, in decode order: the IDR + first, then every sample up to the next IDR, whatever NAL + units each holds + dts_i the sample's DTS: the sum of the `stts` durations of every + sample before it in the track + dts_0 the DTS of segment n's IDR + cts_i the sample's composition offset from `ctts` — version 0 + unsigned, version 1 signed, as ISO/IEC 14496-12 says — + and 0 when the track has no `ctts` + end_n the DTS of segment n's last video sample plus that + sample's own `stts` duration + j = 0 … a−1 the audio frames §5 assigns to segment n (those of + audio_frames(n)), in decode order; a = 0 when it has none + adts_j the frame's DTS in the audio track; adts_0 the first's + adur_j the frame's `stts` duration + + segments[n].timing = base64url( SHA-256( timing(n) ) ) + media.timing.root = base64url( SHA-256( T(0) || T(1) || … || T(segment_count − 1) ) ) + T(n) = the 32 bytes segments[n].timing decodes to + ``` + + - **Every value is an integer in the media timescale of its own track**, + the `mdhd` timescale the file states: video values in the video track's, + audio values in the audio track's. `media.timing.video_timescale` and + `audio_timescale` are those two timescales; `audio_timescale` is + **absent** — never `null`, never 0 — when the file has no `soun` track, + and then every record has `a = 0` (vectors 158, 159). The record is + measured from the segment's own first sample, so where a segment sits — + after a cut, behind an empty edit, in a movie timescale a re-muxer chose + — does not enter it: the edit list enters only through the audio + assignment and the clip rule below. Every field is fixed-length and each + count precedes its list; a value that does not fit its field is a record + that cannot be built. + - **`end_n` is read from the segment alone.** In a sample table it equals + the DTS of IDR n+1 when one follows, and for the last segment it is the + only definition: it is what binds how long the last frame is shown. A + reader MUST NOT take it from the track's `mdhd` duration or from an edit: + `MediaMuxer`'s `mdhd` duration counts the leading delay (vector 175), and + the segment a clip ends on need not be the one its original ended on + (vector 178). + - **What the audio half binds.** Which frames a segment has, their spacing + and their durations. The offset between the tracks is bound only to the + slack of the assignment rule: shifting the audio by less than the gap + between each segment boundary and the nearest audio frame moves no frame + and changes no record — less than one audio frame (21 ms for AAC at + 48 kHz), accepted. + - **The root, without a demuxer.** When the proof carries an entry for every + index from 0 to `segment_count − 1`, a verifier recomputes `root` from + the entries' `timing`; a root that does not match is a binding the proof + makes that does not hold: **tampered** (vector 177), whatever the file. + When an entry is missing the root cannot be recomputed, and no entry's + `timing` is authenticated — they are outside every signature. **A clip's + proof carries every entry**: a writer, a cutter or any tool that carries + a proof along with a clip MUST NOT drop the entries of the segments it + cut (vector 186). + - **Reading it back** (a file that is not the original). For each located + segment the verifier builds `timing(n)` from the received file, in the + received file's timescales, and expresses every value in the signed one: + `t_signed = t_received × ts_signed / ts_received`, video values with + `video_timescale`, audio values with `audio_timescale`. Each result MUST + be an integer; an audio value with no audio timescale on either side, a + result that is not an integer or one that does not fit its field is a + timing that differs. The verifier hashes the converted record and + compares it with the entry's `timing`. A re-mux that keeps a timescale or + multiplies it, durations with it, verifies exactly (vector 182); one that + moves to a timescale unable to represent the signed instants has moved + them — by at most a tick — and reads *timing differs* (vector 181). A + hash admits no tolerance, and a tolerance would be the thing to argue + about. + - **The single media edit** (a file that is not the original). On the + video track and on the audio track, when the edit list has a media edit + — `media_time` m in media ticks, `segment_duration` d in movie ticks, the + track's media timescale T and the movie timescale M — it **trims inside** + a located segment when `m > s`, or when `(d + 1) × T ≤ (e − m) × M` + (the edit ends one movie tick or more before the segment does), where + `[s, e)` is the segment's span on that track in media ticks: for video + from the least `dts_i + cts_i` to the greatest `dts_i + cts_i + dur_i` + (`dur_i` is the next sample's DTS minus `dts_i`, `end_n − dts_i` for the + last), for audio from `adts_0` to the last frame's DTS plus its + duration. The movie tick of slack is the rounding a muxer cannot avoid + when M is coarser than T (vector 178). A track with no media edit shows + all its media and trims nothing. An edit list of any other shape is + already a container §5 does not compare (*The DTS is the container's*). + - **Verdict.** A located segment whose timing does not read back as + signed, whose entry's `timing` the root does not authenticate, or which + the media edit trims, is in the file under a timing nobody signed: + **frames not compared**, no segment credited, with *timing differs* + (vectors 179, 180, 181, 184, 186) — beside *presentation differs* or + *tracks not bound* when those hold too. Not *tampered*: re-timing a clip + is not an accusation, and it is not a verified clip either. Changing the + audio sample rate is *Presentation*'s case, not this one (vector 183). + - **On the original** the verifier builds the record of every segment + from the file — each index from 0 to `segment_count − 1` named by + exactly one GOP — converts them as above, and compares the root they give + with the signed one. The bytes are the sealed ones, so a root that does + not match is the writer's false claim: *timing differs*, amber at best, + never red (vector 185), as for *presentation differs*. The media edit + rule does not apply to an original: `media.hash` covers its edit list. + - **Writer requirements for `media.timing`.** A video writer MUST include + it, and `timing` in every `segments[]` entry: a proof without either is + *no proof found* (§8, vectors 176, 187). It MUST compute both from the + file it produced, after the muxer finalised it and before the trailer is + appended — the sample tables, `mdhd` timescales and edit list a verifier + will read — and never from the encoder's presentation timestamps, the + timescale it asked for or the platform's documentation: a muxer chooses + timescales and edits and rounds every timestamp into them (vector 185 + signs microseconds and describes no file). The segment message does not + change, so the record is read back after the recording stops and no + segment is re-signed: only the core, which a writer signs after that + read-back anyway, and the entries' `timing` change. A writer MUST check + its output against a verifier on a file it produced (vector 175 lists + the records byte for byte). - **Verifier behaviour** on video: - `sig` verifies over the core → the claims are authentic (who, which key, declared when and where). If `sig` fails → **tampered**, red, stop. @@ -758,12 +900,13 @@ sig(n) = ECDSA-P256-SHA256( message(n) ), P1363, low s (§4.2) segment signature verifies, the chain holds wherever two consecutive segments are both present, at least one GOP is located and verified under *Locating segments*, and — when `media.hash` does not match — the - file presents those GOPs as the core says (*Presentation*) → **verified - clip**, amber, reporting which segment indexes verified out of - `segment_count`; + file presents those GOPs as the core says (*Presentation*) and at the + instants it binds (*Timing*) → **verified clip**, amber, reporting which + segment indexes verified out of `segment_count`; - a segment signature fails, or a present segment's `prev` differs from `SHA-256(message(n−1))` while segment n−1 is present (the chain breaks where - the file claims contiguity) → **tampered**, red; + the file claims contiguity), or every entry is present and their `timing` + hashes do not recompute `media.timing.root` (*Timing*) → **tampered**, red; - **a located segment whose `content_hash`, recomputed from the container, differs from the signed one → tampered**, red, reporting which segments do verify; so is every other failure *Locating segments* lists. A contradicted @@ -816,7 +959,8 @@ the capture onwards, each verifiable on its own and each bound to `core_hash`. "v": "vcap/1.0", "capture_id": "base64url, 16 bytes", "media": { "mime", "w", "h", "duration_ms", "hash", "segment_count", - "presentation": { "config", "matrix": [ 9 ], "display": [ 2 ] } }, + "presentation": { "config", "matrix": [ 9 ], "display": [ 2 ] }, + "timing": { "video_timescale", "audio_timescale", "root" } }, "device": { "platform": "android" | "ios" | "web", "secure_hw": "strongbox" | "tee" | "secureEnclave" | "none", "key_id" }, @@ -830,7 +974,7 @@ the capture onwards, each verifiable on its own and each bound to `core_hash`. "sig": { "alg": "ES256", "value": "base64url r||s", "pub": "base64url SPKI" }, // ---- attachments: each self-authenticating, bound to core_hash (§6.2) ---- - "segments": [ { "gop": 0, "hash", "prev", "sig" } ], // "range" is deprecated: writers MUST NOT emit it (§5) + "segments": [ { "gop": 0, "hash", "prev", "sig", "timing" } ], // "range" is deprecated: writers MUST NOT emit it (§5) "attestation": [ "base64url DER leaf", "...", "base64url DER root" ], // omitted on web "attestation_status": { "source", "fetched_at", "entries": [ { "serial", "status", "reason", "revoked_at" } ], "sig" }, "registry": { "log_id", "leaf_index", "leaf": { ... }, "inclusion_path": [ ... ], @@ -909,6 +1053,17 @@ Rules that keep five implementations byte-identical: carry none: `media.hash` covers every byte of a photo, and a photo has no derivation that keeps its signature (a still image that carries `segments` anyway carries the field with them, §8). +- `media.timing` (video) — when the signed frames are shown, so that a clip + cannot freeze, reorder, rescale or trim them (§5 *Timing*): + `video_timescale`, the video track's `mdhd` timescale as the writer's file + states it, an integer from 1 to 2^32 − 1; `audio_timescale`, the same for + the audio track, **absent** when the file has no audio track — never `null` + or 0; `root`, base64url of 32 bytes, the SHA-256 over the segments' timing + hashes in index order. Each `segments[]` entry carries `timing`, base64url + of the 32-byte SHA-256 of its `timing(n)`; it is outside the segment + message and bound by `root`. **Required**, both, wherever `segments` is, + for `media.presentation`'s reason: absent or malformed, the proof is not + well formed and reads *no proof found* (§8, vectors 176, 187). - `device.key_id = base64url( SHA-256( DER SPKI of sig.pub ) )`. Derived, never free; the identifier the registry and the transparency log use. - `device.secure_hw` is the **claimed** level. The verifier computes the @@ -956,6 +1111,7 @@ Field table — type, required, verified against: | `media.hash` | yes | recomputed canonical bytes (§4.1) | | `media.segment_count` | yes (video) | segments present (§5) | | `media.presentation` | yes (video, and wherever `segments` is) | the received container's configuration, `tkhd` and tracks (§5 *Presentation*) | +| `media.timing` | yes (video, and wherever `segments` is) | the entries' `timing` (the root), and each located segment's timing record read back from the received container (§5 *Timing*) | | `device.secure_hw` | yes | proven level from `attestation` (§7) | | `device.key_id` | yes | `sig.pub`, attestation leaf, registry entry | | `watermark` | no | detector output, if the detector ran | @@ -979,7 +1135,7 @@ containing a schema-valid value remain readable under the same rules. | Key | Added by | Self-authenticated by | Bound to the core by | |---|---|---|---| | `sig` | core, at capture | — it *is* the authentication | covers `JCS(core)` | -| `segments` | core, at capture | each `sig(n)` under `sig.pub` | `capture_id` in every message | +| `segments` | core, at capture | each `sig(n)` under `sig.pub`; each entry's `timing` by `media.timing.root` | `capture_id` in every message; `media.timing.root` | | `attestation` | core, at key creation | chain to a pinned Google root / App Attest | leaf SPKI MUST equal `sig.pub` | | `attestation_status` | sync, while the chain is current | registry key signature over the entries it saw | signature covers `core_hash` | | `registry` | sync | inclusion proof against a Signed Tree Head, carried inline | leaf carries `device.key_id` and `sig.pub` | @@ -1558,6 +1714,7 @@ for *key not in transparency log*. | `none` | session key, no attestation, or a chain that does not prove a level | n/a | **amber, never green** | origin not hardware-attested | | any of the above | a video proof whose `content_hash` values were not recomputed from the container (§5) | any | unchanged | segment content not recomputed | | any | an original whose signed `media.presentation` does not describe it (§5 *Presentation*) | — | **amber at best, flagged** | presentation differs | +| any | an original whose signed `media.timing` does not describe it (§5 *Timing*) | — | **amber at best, flagged** | timing differs | | any | claimed level above the level the `attestation` attachment proves | — | **amber at best, flagged** | inconsistent claim | | any | a valid `integrity` attachment whose verdict is `failed` (§6.2) | — | **amber at best, prominently flagged** | integrity failed (and, beside a proven level, integrity not proven) | | any | `sig` invalid, or attestation leaf ≠ `sig.pub` | — | **red** | tampered | @@ -1731,15 +1888,18 @@ that has expired — is only ever as good as the copy in the file. **Required.** `v`, `capture_id`, `media`, `media.mime`, `media.hash`, `media.w`, `media.h`, `device.secure_hw`, `device.key_id`, `sig`, for a video proof `segments`, and for a proof carrying `segments` -`media.segment_count` and `media.presentation`. The pixel dimensions are +`media.segment_count`, `media.presentation`, `media.timing` and `timing` in +every `segments[]` entry. The pixel dimensions are required and are **not** evidence — nothing is proven by them — but every writer holds them at capture, and a reader that cannot say how large the frame is cannot place a watermark payload or a segment in it (vector 46). A proof is a **video proof** when `media.mime` starts with `video/`; nothing else decides it — not the container, not `duration_ms` — so a video proof without `segments` is *no proof found* (vector 34), a video proof without -`media.presentation` is *no proof found* (vector 165), and a still image -carrying `segments` is verified as §5 says, `media.presentation` included. Missing or unparseable → *no proof found*. Present but +`media.presentation` is *no proof found* (vector 165), one without +`media.timing` or with an entry lacking `timing` is *no proof found* +(vectors 176, 187), and a still image carrying `segments` is verified as §5 +says, `media.presentation` and `media.timing` included. Missing or unparseable → *no proof found*. Present but invalid → *tampered*. **Optional, each with its exact label when absent.** Absence is never an error, @@ -1776,6 +1936,7 @@ and the verifier states it rather than staying silent. | `attestation_status` absent, unreadable, `unknown` or incomplete | *chain revocation not checked* | the chain's certificates were not all shown valid while the chain was current (§6.2) | | a video that is not the original, a track beyond the hashed two enabled, or a second video or audio track or sample description | *tracks not bound* | a player may show what no segment hash covers; *frames not compared* (§5) | | a video whose configuration, matrix or display size read back differs from `media.presentation` | *presentation differs* | on a clip *frames not compared*; on an original the writer's false claim, amber (§5, §7) | +| a video whose segment timing read back differs from `media.timing`, a clip whose entries' `timing` the root cannot authenticate, or a clip whose media edit trims inside a located segment | *timing differs* | on a clip *frames not compared*; on an original the writer's false claim, amber (§5 *Timing*, §7) | | an iOS level from a registry leaf | *level from registry records* | the registry's word that the key is in a Secure Enclave; nothing in the file shows it (§7) | **An attachment that is present and does not hold up carries two labels: the @@ -2034,14 +2195,18 @@ says. the original store's `box_purpose` from `manifest` into `original` in place (C2PA A.5.3), inside `media.hash` (`c2pa-interop-1.0.md` §6) - [ ] `REVIEW (mobile)` per-segment signing cost in StrongBox on a long clip -- [ ] `REVIEW (BE)` a clip's timing is not bound: `stts`, `ctts`, the `mdhd` - timescales, the media edit's duration and the audio sample entry are - outside every segment hash and outside `media.presentation`, so a - re-mux can freeze, re-time or reorder the frames of a clip that still - reads *verified clip* (an original is covered by `media.hash`). No - verifier-only rule closes it; a proposal that signs per-segment timing - without changing the segment message is in - `reviews/design-clip-timing.md` +- [x] `REVIEW (BE)` a clip's timing is not bound — resolved in corpus + 7.0.0 (§5 *Timing*): each segment's timing record (`stts`, `ctts`, + the `mdhd` timescales, the last frame's duration and the audio frames' + timing) is hashed into its entry and bound by `media.timing.root`, a + required core field; the media edit may not trim inside a located + segment; the audio sample entry's `esds` joins `media.presentation`. + Design in `reviews/design-clip-timing.md`, accepted 4 October 2026; + vectors 175–187. Still open: a media edit that runs past the end of + the track (what a player shows there is not defined by ISO-BMFF, and + nothing binds it), the audio sample entry's own fields beside the + `esds`, and an `esds` inside a QuickTime `wave` box, which no vector + exercises (no MOV with audio is in the corpus) - [~] `REVIEW (mobile)` NAL byte definition and audio DTS rule reproducible on both encoders — the DTS clock is now named (M8) and the timeline with it (edit lists, §5); H.264 and HEVC on Android are reproduced byte for byte by a second implementation written from this text (`tools/src/container.ts`, the containers of vectors 36 and 37, verified under a presentation-bound core in 166 and 158), which is what "reproducible" was asking; on iOS the NAL bytes are reproduced for HEVC in MOV (vector 48's container, 167) and H.264 in MP4 (vector 85's, 168), and the audio DTS rule is not yet exercised: neither clip has an audio track - [x] `REVIEW (mobile)` hashing two interleaved tracks during encoding — resolved: 8 KB and 0.5 ms per segment on a TEE device (M8) - [ ] `REVIEW (mobile)` metadata stripping before sealing for pseudonymous captures @@ -2080,7 +2245,8 @@ says. (152–164) and `media.presentation` required (165–168), and **171** in corpus 6.1.0 with a sidecar no longer overruled by a worse depth-0 manifest proof (169–171), and **174** in corpus 6.2.0 with - the same rule for a trailer (172–174), + the same rule for a trailer (172–174), and **187** in corpus 7.0.0 + with clip timing bound (175–187), checked by the reference verifier in `tools/`. The §7 vectors trust the anchors in `vectors/_trust/`, whose attestation root is a test root: they prove the level logic, not that an implementation can walk a @@ -2098,7 +2264,8 @@ says. done, both without audio; an iOS clip with audio is still owed. The device proofs of 36, 37, 48 and 85 predate `media.presentation` and read *no proof found* since corpus 5.0.0; their containers are verified - under a re-signed core that carries it in 166, 158, 167 and 168 + under a re-signed core that carries it, and `media.timing` since + corpus 7.0.0, in 166, 158, 167 and 168 - [x] Whether a verifier that cannot recompute segment hashes must say so in its labels: **yes** — *segment content not recomputed* (§5, §7), decided 10 September 2026. Recomputation stays optional, declaring it does diff --git a/tools/src/container.ts b/tools/src/container.ts index d676224..371fe98 100644 --- a/tools/src/container.ts +++ b/tools/src/container.ts @@ -1,4 +1,5 @@ import { createHash } from 'node:crypto' +import { type Extent, type MediaEdit, type Timescales, type TimingValues, audioExtent, videoExtent } from './timing.js' /** * §5 from the container side: given an ISO-BMFF file, recompute @@ -54,11 +55,25 @@ export interface Segment { * day, because they say *where* they disagree. */ hashed: { videoBytes: number, audioBytes: number, audioFrames: number } + /** + * §5 *Timing*: this GOP's `timing(n)` values, in the received file's own + * ticks. A verifier converts them to the signed timescales before hashing; + * a writer hashes them as they are. + */ + timing: TimingValues + /** Where the GOP sits in media time on each track, for the edit-list rule of §5 *Timing*. */ + extent: { video: Extent, audio: Extent | null } } export interface Box { type: string, start: number, end: number, payload: number } -export interface Sample { offset: number, size: number, dts: bigint } +/** + * One sample of a track, in decode order. `dts` is the sum of the `stts` + * durations before it, `duration` its own `stts` duration, and `cts` its + * composition offset from `ctts` (0 without one): the sample is shown at + * `dts + cts`. All three are in the track's media ticks. + */ +export interface Sample { offset: number, size: number, dts: bigint, duration: bigint, cts: bigint } /** * A time on the movie's presentation timeline, kept as an exact fraction of a @@ -87,6 +102,9 @@ interface Track { */ delay: { num: bigint, den: bigint } mediaStart: bigint + /** The single media edit, or null when the track has none (the whole media is shown). */ + mediaEdit: { mediaTime: bigint, duration: bigint } | null + movieTimescale: bigint /** * Set when the edit list does more than delay the track and say where its * media starts: a second edit, a gap after the media, a rate other than 1. @@ -138,8 +156,8 @@ export const find = (list: Box[], type: string): Box | undefined => list.find((b * its signed value, and a verifier that read only the first edit would call * that *verified clip* (vector 156). */ -const editsOf = (file: Buffer, trak: Box, movieTimescale: bigint): { delay: { num: bigint, den: bigint }, mediaStart: bigint, unsupportedEdit?: string } => { - const none = { delay: { num: 0n, den: 1n }, mediaStart: 0n } +const editsOf = (file: Buffer, trak: Box, movieTimescale: bigint): { delay: { num: bigint, den: bigint }, mediaStart: bigint, mediaEdit: { mediaTime: bigint, duration: bigint } | null, unsupportedEdit?: string } => { + const none = { delay: { num: 0n, den: 1n }, mediaStart: 0n, mediaEdit: null } const edts = find(children(file, trak), 'edts') if (!edts) return none const elst = find(children(file, edts), 'elst') @@ -160,11 +178,14 @@ const editsOf = (file: Buffer, trak: Box, movieTimescale: bigint): { delay: { nu // media_rate_integer, then media_rate_fraction: 1.0 is 0x0001 0000. const rate = file.readInt16BE(at + entrySize - 4) const delay = { num: delayTicks, den: movieTimescale } - if (rate !== 1) return { delay, mediaStart: mediaTime, unsupportedEdit: 'edit list changes rate' } - if (i + 1 < count) return { delay, mediaStart: mediaTime, unsupportedEdit: 'edit list has more than one edit after the leading delay' } - return { delay, mediaStart: mediaTime } + // The one media edit: where the media starts, and — what §5 *Timing* + // reads on a clip — for how long it is shown. + const mediaEdit = { mediaTime, duration } + if (rate !== 1) return { delay, mediaStart: mediaTime, mediaEdit, unsupportedEdit: 'edit list changes rate' } + if (i + 1 < count) return { delay, mediaStart: mediaTime, mediaEdit, unsupportedEdit: 'edit list has more than one edit after the leading delay' } + return { delay, mediaStart: mediaTime, mediaEdit } } - return { delay: { num: delayTicks, den: movieTimescale }, mediaStart: 0n } + return { delay: { num: delayTicks, den: movieTimescale }, mediaStart: 0n, mediaEdit: null } } export const children = (file: Buffer, box: Box): Box[] => boxes(file, box.payload, box.end) @@ -211,6 +232,7 @@ export const samplesOf = (file: Buffer, stbl: Box): Sample[] => { const stco = find(kids, 'stco') const co64 = find(kids, 'co64') const stts = find(kids, 'stts') + const ctts = find(kids, 'ctts') if (!stsz || !stsc || !(stco || co64) || !stts) throw new ContainerMalformed('stbl is missing a required table') const sampleCount = u32(file, stsz.payload + 8) @@ -247,6 +269,21 @@ export const samplesOf = (file: Buffer, stbl: Box): Sample[] => { for (let n = 0; n < count; n++) deltas.push(delta) } + // ctts gives composition offsets, run-length coded too. ISO/IEC 14496-12: + // version 0 stores them unsigned, version 1 signed. Read as the version + // says, so two readers agree on a value even where a muxer meant otherwise. + const offsets: bigint[] = [] + if (ctts) { + const signed = file[ctts.payload] === 1 + const offsetRuns = u32(file, ctts.payload + 4) + for (let i = 0; i < offsetRuns; i++) { + const at = ctts.payload + 8 + i * 8 + const count = u32(file, at) + const offset = BigInt(signed ? file.readInt32BE(at + 4) : u32(file, at + 4)) + for (let n = 0; n < count; n++) offsets.push(offset) + } + } + const samples: Sample[] = [] let sample = 0 let dts = 0n @@ -256,8 +293,9 @@ export const samplesOf = (file: Buffer, stbl: Box): Sample[] => { let offset = chunkOffsets[chunk] ?? 0 for (let i = 0; i < perChunk && sample < sampleCount; i++) { const size = sizes[sample] ?? 0 - samples.push({ offset, size, dts }) - dts += BigInt(deltas[sample] ?? deltas[deltas.length - 1] ?? 0) + const duration = BigInt(deltas[sample] ?? deltas[deltas.length - 1] ?? 0) + samples.push({ offset, size, dts, duration, cts: offsets[sample] ?? 0n }) + dts += duration offset += size sample++ } @@ -288,7 +326,7 @@ const tracksOf = (file: Buffer): Track[] => { if (!stsd) continue const codec = codecOf(file, stsd) const samples = samplesOf(file, stbl) - tracks.push({ ...codec, timescale, ...editsOf(file, trak, movieTimescale), samples }) + tracks.push({ ...codec, timescale, movieTimescale, ...editsOf(file, trak, movieTimescale), samples }) } return tracks } @@ -416,7 +454,16 @@ const instantOf = (track: Track, dts: bigint): Instant => { */ export type ContainerReading = | { kind: 'unreadable', reason: string } - | { kind: 'gops', gops: Segment[], presentation: Presentation | null, layout: string | null } + | { + kind: 'gops' + gops: Segment[] + presentation: Presentation | null + layout: string | null + /** The `mdhd` timescales the timing values are in; `audio` null without an audio track. */ + timescales: Timescales + /** Each track's single media edit, null where the track has no edit list or no media edit. */ + edits: { video: MediaEdit | null, audio: MediaEdit | null } + } /** * §5 *Presentation*, read from the received file: `config` is SHA-256 of the @@ -476,14 +523,37 @@ const u32be = (n: number): Buffer => { const b = Buffer.alloc(4); b.writeUInt32B /** * §5 *Presentation*: `uint32 n ‖ (uint32 length ‖ NAL unit) × n` over the * decoder configuration's parameter sets, ordered by NAL unit type and, within - * a type, as the record lists them; then the sample entry's `clap`, `pasp` - * and `colr` boxes, whole, in file order. + * a type, as the record lists them; then `X`: the video sample entry's `clap`, + * `pasp` and `colr` boxes, whole, in file order, followed by the audio sample + * entry's `esds` boxes (`audioEsds`, see `esdsOf`). */ -export const presentationMessage = (file: Buffer, entry: Box, config: Box, hevc: boolean): Buffer => { +export const presentationMessage = (file: Buffer, entry: Box, config: Box, hevc: boolean, audioEsds: Box[] = []): Buffer => { const type = (u: Buffer): number => hevc ? ((u[0] as number) >> 1) & 0x3f : (u[0] as number) & 0x1f const units = parameterSets(file, config, hevc).map((u, i) => ({ u, i })).sort((a, b) => type(a.u) - type(b.u) || a.i - b.i).map(({ u }) => u) const extras = boxes(file, entry.payload + 78, entry.end).filter((b) => b.type === 'clap' || b.type === 'pasp' || b.type === 'colr') - return Buffer.concat([u32be(units.length), ...units.flatMap((u) => [u32be(u.length), u]), ...extras.map((b) => file.subarray(b.start, b.end))]) + return Buffer.concat([u32be(units.length), ...units.flatMap((u) => [u32be(u.length), u]), ...[...extras, ...audioEsds].map((b) => file.subarray(b.start, b.end))]) +} + +/** + * The `esds` boxes of an audio sample entry, whole, in file order (§5 + * *Presentation*). The AudioSpecificConfig inside says the sample rate and + * channel layout a decoder uses: change it and the same coded frames play + * pitched and re-timed, which no `content_hash` and no `timing(n)` notices. + * + * Where they are: an `mp4a` entry's child boxes start 28 bytes into its + * payload (SampleEntry 8, then the AudioSampleEntry fields 20); a QuickTime + * sound description of version 1 or 2 has 16 or 36 more bytes before them, + * and may hold the `esds` inside a `wave` child instead. Any other audio + * codec binds nothing here. + */ +const esdsOf = (file: Buffer, entry: Box): Box[] => { + if (entry.type !== 'mp4a' || entry.payload + 28 > entry.end) return [] + const version = file.readUInt16BE(entry.payload + 8) + const start = entry.payload + 28 + (version === 1 ? 16 : version === 2 ? 36 : 0) + if (start > entry.end) return [] + const kids = boxes(file, start, entry.end) + const wave = find(kids, 'wave') + return [...kids, ...(wave ? children(file, wave) : [])].filter((b) => b.type === 'esds') } /** @@ -496,6 +566,20 @@ const presentationOf = (file: Buffer): { presentation: Presentation | null, layo let presentation: Presentation | null = null let seenVideo = false const handlers: { handler: string, enabled: boolean, entries: number }[] = [] + // The first `soun` track's sample entry: its `esds` joins `X`. Read before + // the video loop, since the audio track may come first in `moov`. + const audioEsds: Box[] = [] + for (const trak of children(file, moov).filter((b) => b.type === 'trak')) { + const mdia = find(children(file, trak), 'mdia') + const hdlr = mdia ? find(children(file, mdia), 'hdlr') : undefined + if (!hdlr || hdlr.payload + 12 > hdlr.end || file.toString('latin1', hdlr.payload + 8, hdlr.payload + 12) !== 'soun') continue + const minf = mdia ? find(children(file, mdia), 'minf') : undefined + const stbl = minf ? find(children(file, minf), 'stbl') : undefined + const stsd = stbl ? find(children(file, stbl), 'stsd') : undefined + const entry = stsd && stsd.payload + 8 <= stsd.end ? boxes(file, stsd.payload + 8, stsd.end)[0] : undefined + if (entry) audioEsds.push(...esdsOf(file, entry)) + break + } for (const trak of children(file, moov).filter((b) => b.type === 'trak')) { const tkhd = find(children(file, trak), 'tkhd') const mdia = find(children(file, trak), 'mdia') @@ -521,7 +605,7 @@ const presentationOf = (file: Buffer): { presentation: Presentation | null, layo const config = find(boxes(file, entry.payload + 78, entry.end), hevc ? 'hvcC' : 'avcC') if (!config || !header) break let message: Buffer - try { message = presentationMessage(file, entry, config, hevc) } catch { break } + try { message = presentationMessage(file, entry, config, hevc, audioEsds) } catch { break } presentation = { config: createHash('sha256').update(message).digest(), matrix: Array.from({ length: 9 }, (_, i) => file.readInt32BE(at + 4 * i)), @@ -589,9 +673,15 @@ export const readContainer = (file: Buffer): ContainerReading => { const starts: number[] = [] units.forEach((unit, i) => { if (unit.idr || i === 0) starts.push(i) }) + const mediaEdit = (track: Track | undefined): MediaEdit | null => track?.mediaEdit + ? { ...track.mediaEdit, movieTimescale: track.movieTimescale, mediaTimescale: track.timescale } + : null + return { kind: 'gops', ...bound, + timescales: { video: video.timescale, audio: audio ? audio.timescale : null }, + edits: { video: mediaEdit(video), audio: mediaEdit(audio) }, gops: starts.map((from, gop): Segment => { const to = starts[gop + 1] ?? units.length const hash = createHash('sha256') @@ -602,9 +692,26 @@ export const readContainer = (file: Buffer): ContainerReading => { let videoBytes = 0 let audioBytes = 0 let audioFrames = 0 + // §5 *Timing*: every video sample of the GOP in decode order, measured + // from the GOP's first sample (the IDR, dts_0). + const dts0 = (units[from] as (typeof units)[number]).sample.dts + const last = (units[to - 1] as (typeof units)[number]).sample + const timing: TimingValues = { + videoDts: [], + videoCts: [], + // end_n: the last sample's DTS plus its own duration, never the next + // GOP's DTS or the track's mdhd duration — the record of a segment is + // read from that segment alone, so a clip that cut what follows it + // (or a re-muxer that left mdhd stale) reads the same value. + videoEnd: last.dts + last.duration - dts0, + audioDts: [], + audioDur: [] + } for (let i = from; i < to; i++) { const { sample, nals } = units[i] as (typeof units)[number] + timing.videoDts.push(sample.dts - dts0) + timing.videoCts.push(sample.cts) start = Math.min(start, sample.offset) end = Math.max(end, sample.offset + sample.size) for (const nal of nals) { @@ -619,6 +726,7 @@ export const readContainer = (file: Buffer): ContainerReading => { } } + let adts0: bigint | null = null if (audio) { // The half-open interval of §5, on the presentation timeline both // tracks share: [ DTS(IDR n), DTS(IDR n+1) ), and to the end of the @@ -634,6 +742,11 @@ export const readContainer = (file: Buffer): ContainerReading => { hash.update(file.subarray(sample.offset, sample.offset + sample.size)) audioBytes += sample.size audioFrames++ + // The same frames, in the same order, enter timing(n): their DTS + // measured from the segment's first audio frame, and their duration. + adts0 ??= sample.dts + timing.audioDts.push(sample.dts - adts0) + timing.audioDur.push(sample.duration) } } @@ -647,7 +760,9 @@ export const readContainer = (file: Buffer): ContainerReading => { contentHash: hash.digest(), range: { start, end }, located: first !== undefined, - hashed: { videoBytes, audioBytes, audioFrames } + hashed: { videoBytes, audioBytes, audioFrames }, + timing, + extent: { video: videoExtent(timing, dts0), audio: adts0 === null ? null : audioExtent(timing, adts0) } } }) } diff --git a/tools/src/generate.ts b/tools/src/generate.ts index 49edc1c..513515f 100644 --- a/tools/src/generate.ts +++ b/tools/src/generate.ts @@ -7,6 +7,7 @@ import { mediaHash } from './canonical.js' import { Flag, buildTrailer, parseTrailer } from './trailer.js' import { type Box, boxes, children, codecOf, containerSegments, find, readContainer, samplesOf } from './container.js' import { remux } from './remux.js' +import { type TimingValues, timingRecord, timingRoot } from './timing.js' import { type SegmentEntry, SEPARATOR, ZERO_LINK, linkOf, segmentMessage } from './segments.js' // Deterministic ES256 (RFC 6979): regenerating an unchanged vector must not // change its bytes. See sign.ts. @@ -106,7 +107,7 @@ const bmffBox = (type: string, payload: Buffer): Buffer => { // ---- vectors -------------------------------------------------------------- -interface FileVector { kind: 'file', container?: boolean, name: string, ext: string, file: Buffer, sidecar?: Buffer, proof?: Proof, expected: Partial & { outcome: Verdict['outcome'] }, schemaValid?: boolean, notes: string, verifierClock?: number, keyStatus?: Json, chainRead?: Json } +interface FileVector { kind: 'file', container?: boolean, name: string, ext: string, file: Buffer, sidecar?: Buffer, proof?: Proof, expected: Partial & { outcome: Verdict['outcome'] }, schemaValid?: boolean, notes: string, verifierClock?: number, keyStatus?: Json, chainRead?: Json, debug?: Json } interface SegVector { kind: 'segments', name: string, input: { capture_id: string, pub: string, segment_count: number, segments: SegmentEntry[] }, expected: Partial & { outcome: Verdict['outcome'] }, notes: string, debug?: Json } interface JcsVector { kind: 'jcs', name: string, input: Json, expected: { core_bytes_hex: string, core_hash: string }, notes: string } type Vector = FileVector | SegVector | JcsVector @@ -382,17 +383,49 @@ const presentationOf = (media: Buffer): Json => { if (reading.kind !== 'gops' || reading.presentation === null) throw new Error('no readable presentation') return { config: reading.presentation.config.toString('base64url'), matrix: reading.presentation.matrix, display: reading.presentation.display } } -const videoCore = (media: Buffer, extra: Proof = {}): Proof => photoCore(media, 'video/mp4', { - media: { mime: 'video/mp4', w: 16, h: 16, duration_ms: 67, hash: mediaHash(media), segment_count: 3, presentation: presentationOf(media) }, +/** + * §5 *Timing*: `media.timing` and each segment's timing hash, as a writer + * reads them back from the file it muxed — the `mdhd` timescales and one + * `timing(n)` per GOP its vcap SEI names, hashed, then the root over all of + * them in index order. + */ +const timingOf = (media: Buffer, count: number): { timing: Json, hashes: Buffer[], records: Buffer[] } => { + const reading = readContainer(media) + if (reading.kind !== 'gops') throw new Error('no readable timing') + const records = new Map() + for (const gop of reading.gops) if (gop.index !== null) records.set(gop.index, timingRecord(gop.timing)) + const ordered = Array.from({ length: count }, (_, n) => { + const record = records.get(n) + if (!record) throw new Error(`timing: no GOP names segment ${n}`) + return record + }) + const hashes = ordered.map((r) => createHash('sha256').update(r).digest()) + return { + timing: { video_timescale: Number(reading.timescales.video), ...(reading.timescales.audio !== null ? { audio_timescale: Number(reading.timescales.audio) } : {}), root: timingRoot(hashes).toString('base64url') }, + hashes, + records: ordered + } +} +/** A signed chain with each entry's timing hash beside it: what a writer emits. */ +const withTiming = (entries: SegmentEntry[], hashes: Buffer[]): SegmentEntry[] => + entries.map((e) => ({ ...e, timing: (hashes[e.gop] as Buffer).toString('base64url') })) +// The chain of vector 25 is synthetic — content hashes of no real GOP — and so +// are the timing hashes beside it: the file vectors that carry it (33, 165) +// check the signature layer only, where the root is recomputed from entries. +const syntheticTiming = [0, 1, 2].map((i) => createHash('sha256').update(`segment timing ${i}`).digest()) +const timedChain = withTiming(chain, syntheticTiming) +const videoCore = (media: Buffer, extra: Proof = {}, timing?: Json): Proof => photoCore(media, 'video/mp4', { + media: { mime: 'video/mp4', w: 16, h: 16, duration_ms: 67, hash: mediaHash(media), segment_count: 3, presentation: presentationOf(media), ...(timing ? { timing } : {}) }, watermark: { algo: 'videoseal', layout: 'video-rep-v1', payload_bits: 128, ecc: 'bch-255-131', strength: 8 }, ...extra }) +const SYNTHETIC_TIMING: Json = { video_timescale: 15360, root: timingRoot(syntheticTiming).toString('base64url') } { - const proof = sign(videoCore(baseMp4, { segments: chain as unknown as Json })) + const proof = sign(videoCore(baseMp4, { segments: timedChain as unknown as Json }, SYNTHETIC_TIMING)) file({ name: '33-mp4-video-sealed', ext: 'mp4', file: seal(baseMp4, proof), proof, expected: { outcome: 'authentic', labels: [...PHOTO_LABELS, 'segment content not recomputed'], not_evaluated: [], core_hash: hashOf(proof), segments: { verified: [] } }, - notes: 'An ISO-BMFF video with media.mime video/mp4, segment_count 3 and the complete chain of vector 25 in the trailer (flag SEGMENTS set). Canonical bytes are the file minus the trailer (§4.1) and `media.hash` matches, so the file is the one the device sealed: **authentic**. The chain is checked at message level only — this is a `file` vector, the container is not demuxed — and the verdict says so with *segment content not recomputed* (§7).\n\n`segments.verified` is **empty**, and that is the rule of §5 (*Locating segments*): a segment counts as verified only once a GOP of this file has been located and its `content_hash` recomputed. Here the signatures hold and nothing was compared; the file is authentic because `media.hash` covers every byte, not because any segment was checked. Vectors 38, 39, 86-94 and 166-168 are the same question asked of the container.' }) + notes: 'An ISO-BMFF video with media.mime video/mp4, segment_count 3 and the complete chain of vector 25 in the trailer (flag SEGMENTS set). Like its content hashes, the chain\'s timing hashes are synthetic — no GOP of this file is behind them — and `media.timing.root` is over them: a `file` vector checks the root against the entries and nothing against the container (§5 *Timing*). Canonical bytes are the file minus the trailer (§4.1) and `media.hash` matches, so the file is the one the device sealed: **authentic**. The chain is checked at message level only — this is a `file` vector, the container is not demuxed — and the verdict says so with *segment content not recomputed* (§7).\n\n`segments.verified` is **empty**, and that is the rule of §5 (*Locating segments*): a segment counts as verified only once a GOP of this file has been located and its `content_hash` recomputed. Here the signatures hold and nothing was compared; the file is authentic because `media.hash` covers every byte, not because any segment was checked. Vectors 38, 39, 86-94 and 166-168 are the same question asked of the container.' }) } { @@ -406,13 +439,13 @@ const videoCore = (media: Buffer, extra: Proof = {}): Proof => photoCore(media, { // Signed without the field, not stripped after signing: a writer that never // wrote it, which is what every video proof sealed before corpus 5.0.0 is. - const core = videoCore(baseMp4, { segments: chain as unknown as Json }) + const core = videoCore(baseMp4, { segments: timedChain as unknown as Json }, SYNTHETIC_TIMING) const { presentation: _presentation, ...media } = core.media as Record const proof = sign({ ...core, media }) file({ name: '165-mp4-video-without-presentation', ext: 'mp4', file: seal(baseMp4, proof), proof, expected: { outcome: 'no_proof_found', labels: [], not_evaluated: [] }, schemaValid: false, - notes: 'Vector 33 with a core signed without `media.presentation`: segments, `segment_count` and a valid signature over a core that never carried the field. §6.1 and §8 require it of every proof that carries `segments`, and so of every video proof — missing required field, **no proof found**, the answer vector 34 gets for a video proof without `segments`, and the shape check gives it before the signature is read.\n\nUntil corpus 5.0.0 the field was required of writers and optional to readers: an original without it read *authentic* and every clip of it *frames not compared*, *presentation not bound*. That left a video proof two verdicts depending on which file it was attached to, and a core with nothing to hold a clip\'s parameter sets, matrix or tracks against. The device captures 36, 37, 48 and 85 predate the field and now read the same.' }) + notes: 'Vector 33 with a core signed without `media.presentation` (it carries `media.timing`, so that is the one field missing): segments, `segment_count` and a valid signature over a core that never carried the field. §6.1 and §8 require it of every proof that carries `segments`, and so of every video proof — missing required field, **no proof found**, the answer vector 34 gets for a video proof without `segments`, and the shape check gives it before the signature is read.\n\nUntil corpus 5.0.0 the field was required of writers and optional to readers: an original without it read *authentic* and every clip of it *frames not compared*, *presentation not bound*. That left a video proof two verdicts depending on which file it was attached to, and a core with nothing to hold a clip\'s parameter sets, matrix or tracks against. The device captures 36, 37, 48 and 85 predate the field and now read the same.' }) } @@ -440,19 +473,23 @@ const videoCore = (media: Buffer, extra: Proof = {}): Proof => photoCore(media, if (parsed.kind !== 'ok') throw new Error(`${name}: no readable trailer`) return { file, media: file.subarray(0, parsed.mediaEnd), trailer: file.subarray(parsed.mediaEnd), payload: parsed.payload, proof: JSON.parse(parsed.payload.toString('utf8')) as Proof } } - /** A device capture's core, re-signed with the test key and carrying `presentation`. */ - const resignedProof = (device: Sealed, presentation: Json): Proof => { + /** + * A device capture's core, re-signed with the test key and carrying + * `presentation` and `timing`, both read back from the device's container, + * with each segment entry's timing hash beside its re-signed message. + */ + const resignedProof = (device: Sealed, presentation: Json, read = timingOf(device.media, (device.proof.media as Proof).segment_count as number)): Proof => { const claimed = device.proof.device as Proof const core: Proof = { v: 'vcap/1.0', capture_id: device.proof.capture_id as string, - media: { ...(device.proof.media as Proof), presentation }, + media: { ...(device.proof.media as Proof), presentation, timing: read.timing }, device: { platform: claimed.platform as string, secure_hw: claimed.secure_hw as string, key_id: KEY_ID }, ...('watermark' in device.proof ? { watermark: device.proof.watermark as Json } : {}), time: device.proof.time as Json } const hashes = (device.proof.segments as unknown as SegmentEntry[]).map((e) => Buffer.from(e.hash, 'base64url')) - return sign({ ...core, segments: signChain(Buffer.from(core.capture_id as string, 'base64url'), hashes, privateKey) as unknown as Json }) + return sign({ ...core, segments: withTiming(signChain(Buffer.from(core.capture_id as string, 'base64url'), hashes, privateKey), read.hashes) as unknown as Json }) } const resigned = (device: Sealed): Sealed => { const proof = resignedProof(device, presentationOf(device.media)) @@ -465,7 +502,7 @@ const videoCore = (media: Buffer, extra: Proof = {}): Proof => photoCore(media, const h264 = resigned(h264Device) const hevc = resigned(hevcDevice) const DEVICE_LABELS = ['integrity unevaluated', 'key not in transparency log', 'no trusted time', 'no watermark', 'not anchored', 'origin not hardware-attested'] - const provenance = 'Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device\'s; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0).' + const provenance = 'Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device\'s; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device\'s container), which the device proof predates (corpora 5.0.0 and 7.0.0).' const device = (v: Omit & { notes: string }): void => file({ ...v, container: true, ext: 'mp4', notes: `${v.notes}\n\n${provenance}` }) @@ -500,7 +537,7 @@ const videoCore = (media: Buffer, extra: Proof = {}): Proof => photoCore(media, const ios = (source: string, input: string, name: string, ext: string, expected: FileVector['expected'], notes: string): void => { const sealed = resigned(deviceFile(source, input)) file({ name, container: true, ext, file: sealed.file, proof: sealed.proof, expected: { ...expected, core_hash: hashOf(sealed.proof) }, - notes: `${notes}\n\nThe container is the iPhone capture of vector ${source.slice(0, 2)} (an iPhone 11 Pro, iOS 18.6.2, \`AVAssetWriter\`); the core and the segment chain are re-signed with the test key in \`tools/src/testkey.ts\`, over the same capture id and the same content hashes, so that the core carries \`media.presentation\`, which the proof of vector ${source.slice(0, 2)} predates (corpus 5.0.0).` }) + notes: `${notes}\n\nThe container is the iPhone capture of vector ${source.slice(0, 2)} (an iPhone 11 Pro, iOS 18.6.2, \`AVAssetWriter\`); the core and the segment chain are re-signed with the test key in \`tools/src/testkey.ts\`, over the same capture id and the same content hashes, so that the core carries \`media.presentation\` and \`media.timing\`, which the proof of vector ${source.slice(0, 2)} predates (corpora 5.0.0 and 7.0.0).` }) } const IOS_LEVEL = { claimed: 'secureEnclave', proven: 'none', ceiling: 'amber' } as const ios('48-mov-container-ios', 'input.mov', '167-mov-container-ios-presentation', 'mov', @@ -585,7 +622,7 @@ const videoCore = (media: Buffer, extra: Proof = {}): Proof => photoCore(media, }) device({ name: '89-mp4-container-cut-clip', file: Buffer.concat([cut, h264.trailer]), proof: h264.proof, expected: { outcome: 'verified_clip', labels: DEVICE_LABELS, not_evaluated: [], core_hash: hashOf(h264.proof), segments: { verified: [1, 2] }, location: { claimed: 'none', level: 'none' } }, - notes: 'Vector 36 **cut**: its first GOP removed from the video track, the audio frames before the cut removed with it, and the full proof — all three segments — still in the trailer. This is what a clip is: the file lacks segment 0, the proof does not.\n\nEvery surviving sample keeps its instant on the movie timeline (the movie timescale becomes 90 kHz and each track gets an empty edit for the time that was cut), so §5\'s audio rule assigns the same frames to segments 1 and 2 as in the original, and both recompute. `remux.ts` copies the decoder configuration, the track header and the track layout as they were, so the clip presents its frames as the core\'s `media.presentation` says (§5 *Presentation*). **Verified clip**, 1 and 2 of 3. Segment 0 is signed and absent, which is the clip case and never *tampered*; `media.hash` does not match, which is what says this is not the original.\n\nVector 38 removed segment 0 from the **proof** and left it in the file; under the binding rule that is a GOP no signature covers, and it reads *tampered*.' }) + notes: 'Vector 36 **cut**: its first GOP removed from the video track, the audio frames before the cut removed with it, and the full proof — all three segments — still in the trailer. This is what a clip is: the file lacks segment 0, the proof does not.\n\nEvery surviving sample keeps its instant on the movie timeline (the movie timescale becomes 90 kHz and each track gets an empty edit for the time that was cut), so §5\'s audio rule assigns the same frames to segments 1 and 2 as in the original, and both recompute. `remux.ts` copies the decoder configuration, the track header and the track layout as they were, so the clip presents its frames as the core\'s `media.presentation` says (§5 *Presentation*); and it keeps every `stts` duration and both timescales, so each segment\'s timing record reads back as `media.timing` binds it (§5 *Timing*). **Verified clip**, 1 and 2 of 3. Segment 0 is signed and absent, which is the clip case and never *tampered*; `media.hash` does not match, which is what says this is not the original.\n\nVector 38 removed segment 0 from the **proof** and left it in the file; under the binding rule that is a GOP no signature covers, and it reads *tampered*.' }) // §3.1 on a clip: another capture's video proof appended as a trailer to // the trailer-stripped clip, the genuine proof beside it. The foreign @@ -594,10 +631,203 @@ const videoCore = (media: Buffer, extra: Proof = {}): Proof => photoCore(media, // holds, and no GOP of the clip names its capture. const capture = Buffer.alloc(16, 0x73) const hashes = (h264.proof.segments as unknown as SegmentEntry[]).map((e) => Buffer.from(e.hash, 'base64url')) - const foreign = sign({ ...h264.proof, capture_id: capture.toString('base64url'), segments: signChain(capture, hashes, privateKey) as unknown as Json }) + const timings = (h264.proof.segments as unknown as SegmentEntry[]).map((e) => Buffer.from(e.timing as string, 'base64url')) + const foreign = sign({ ...h264.proof, capture_id: capture.toString('base64url'), segments: withTiming(signChain(capture, hashes, privateKey), timings) as unknown as Json }) device({ name: '173-mp4-container-foreign-trailer-sidecar', file: seal(cut, foreign), sidecar: h264.payload, proof: h264.proof, expected: { outcome: 'verified_clip', labels: [...DEVICE_LABELS, 'trailer copy differs'], not_evaluated: [], core_hash: hashOf(h264.proof), segments: { verified: [1, 2] }, location: { claimed: 'none', level: 'none' }, proof_source: { kind: 'sidecar' }, frames_name_capture: true }, notes: 'Vector 89\'s clip of vector 166 — GOP 0 removed — with its trailer stripped and **another capture\'s** video proof appended as a valid trailer in its place: vector 166\'s core and segment hashes under a new capture id, the core and every segment message re-signed for it. Next to it, a sidecar holding vector 166\'s proof. Every signature in the trailer\'s proof holds, and no GOP of the clip names its capture, so on its own it reads *frames not compared* (§5, *Locating segments*) — a genuine clip reduced to "nothing ties these signatures to these frames" by a trailer anyone can append.\n\n§3.1 judges both over the same bytes, the file without the trailer: the sidecar\'s proof locates GOPs 1 and 2 and recomputes them, **verified clip**, 1 and 2 of 3 — vector 89\'s verdict — which ranks above *frames not compared*, so it stands, with *trailer copy differs* and `proof_source` the sidecar. Vector 171 is the same case with the foreign proof in a C2PA manifest.' }) + + // ---- §5 *Timing*: when the signed frames are shown --------------------- + // + // Vector 166's original and vector 89's cut of it, under the re-signed + // core that carries `media.timing`. Each clip below is `remux.ts` output + // that keeps every sample, every vcap SEI and §5's audio assignment — + // every GOP still hashes to its signed `content_hash` — and changes one + // timing table, which is exactly what no signed byte covered before. + const LOCATION = { claimed: 'none', level: 'none' } as const + const clipPlan = { samples: gops.slice(1).flatMap(range), sync: 'keep' as const } + const keptAudioIndexes = keptAudio.map(({ i }) => i) + const timingNote = 'The container is vector 36\'s Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166\'s re-signed core, which carries `media.timing` (corpus 7.0.0).' + const timed = (v: Omit & { notes: string }): void => + file({ ...v, container: true, ext: 'mp4', notes: `${v.notes}\n\n${timingNote} Generated by \`tools/src/generate.ts\` with the test key in \`tools/src/testkey.ts\`.` }) + const RETIMED = { outcome: 'frames_not_compared' as const, labels: [...DEVICE_LABELS, 'timing differs'].sort(), not_evaluated: [], core_hash: hashOf(h264.proof), segments: { verified: [] }, location: LOCATION } + + { + const read = timingOf(h264.media, 3) + timed({ name: '175-mp4-timing-original', file: h264.file, proof: h264.proof, + expected: { outcome: 'authentic', labels: DEVICE_LABELS, not_evaluated: [], core_hash: hashOf(h264.proof), segments: { verified: [0, 1, 2] }, location: LOCATION }, + debug: { + video_timescale: Number((read.timing as { video_timescale: number }).video_timescale), + audio_timescale: Number((read.timing as { audio_timescale: number }).audio_timescale), + timing_records_hex: read.records.map((r) => r.toString('hex')), + timing_hashes_hex: read.hashes.map((h) => h.toString('hex')), + root_hex: timingRoot(read.hashes).toString('hex') + }, + notes: 'Vector 166\'s file and proof, with the timing records spelled out. The core carries `media.timing` (§6.1): the `mdhd` timescales the muxer wrote (video 90 000, audio 48 000) and the root over the three segments\' timing hashes; each `segments[]` entry carries `SHA-256(timing(n))` (§5 *Timing*). `debug.timing_records_hex` gives each `timing(n)` byte for byte — `uint32 v`, then `(int64 dts_i − dts_0 ‖ int64 cts_i) × v`, `uint64 end_n − dts_0`, `uint32 a`, `(int64 adts_j − adts_0 ‖ uint32 adur_j) × a` — so an implementation can compare its record before it compares a hash.\n\nWhat a real file puts in it: video durations that wander around 3000 ticks (one of 4885 where the encoder dropped a frame), no `ctts`, so every `cts_i` is 0; `end_n` of segment 2 is its last sample\'s DTS plus that sample\'s own duration; and the audio frames §5 assigns by DTS on the presentation timeline — the 473 ms empty edit on the video track included — each 1024 ticks. The video `mdhd` duration is not where `end_n` comes from: `MediaMuxer` wrote 260 759 ticks, the media plus the 473 ms delay, while the samples end at 218 178 — the value the media edit\'s `segment_duration` (24 242 at the 10 kHz movie timescale) agrees with. **Authentic**, every segment recomputed.' }) + } + + { + // Signed without the field: a writer that predates it. Its entries + // carry no timing hash either. + const { timing: _timing, ...media } = h264.proof.media as Record + const bare = (h264.proof.segments as unknown as SegmentEntry[]).map(({ timing: _t, ...entry }) => entry) + const proof = sign({ ...h264.proof, media, segments: bare as unknown as Json }) + timed({ name: '176-mp4-timing-missing', file: seal(h264.media, proof), proof, + expected: { outcome: 'no_proof_found', labels: [], not_evaluated: [] }, + schemaValid: false, + notes: 'Vector 175 with a core signed without `media.timing` and segment entries without `timing`: a writer that predates corpus 7.0.0. §6.1 and §8 require the field of every proof that carries `segments`, as they require `media.presentation`: the core is signed once and attached to every clip cut from it, so a field a clip depends on cannot be optional to the original. Missing required field — **no proof found**, before the signature is read (vector 165 is the same answer for `media.presentation`).' }) + } + + { + // Entry 1's timing hash replaced by the hash of a record with one + // video duration lengthened: a re-timed segment 1, declared. + const entries = (h264.proof.segments as unknown as SegmentEntry[]).map((e) => e.gop === 1 ? { ...e, timing: createHash('sha256').update('a timing nobody signed').digest('base64url') } : e) + const proof = { ...h264.proof, segments: entries as unknown as Json } + timed({ name: '177-mp4-timing-entry-not-in-root', file: seal(h264.media, proof), proof, + expected: { outcome: 'tampered', labels: [], not_evaluated: [], core_hash: hashOf(proof), segments: { verified: [0, 1, 2] } }, + notes: 'Vector 175 with segment 1\'s `timing` hash in the proof replaced after signing. The entry\'s `timing` is outside the 96-byte segment message and outside every signature: what binds it is `media.timing.root` in the signed core. With every entry present a verifier recomputes the root from the entries — no demuxer needed — and here it does not match: a binding the proof makes that does not hold, **tampered** (§5 *Timing*). `segments.verified` still lists the three GOPs whose content recomputes, as on vector 90: the contents are intact, the proof is not.' }) + } + + { + // Cut at the end instead: GOP 2 removed, and the audio frames §5 would + // have given it. The delay and the timescales stay as the device wrote + // them, and the video's media edit is rounded down into the 10 kHz movie + // timescale, as a muxer has to. + const idr2 = (video[(gops[2] as { first: number }).first] as { dts: bigint }).dts + const endAudio = audio.map((s, i) => ({ s, i })).filter(({ s }) => s.dts * 90000n < (4731n * 9n + idr2) * 48000n).map(({ i }) => i) + const ended = remux(h264.media, { + video: { samples: gops.slice(0, 2).flatMap(range), delay: 4731n, sync: 'keep' }, + audio: { samples: endAudio } + }) + timed({ name: '178-mp4-timing-clip-end-cut', file: Buffer.concat([ended, h264.trailer]), proof: h264.proof, + expected: { outcome: 'verified_clip', labels: DEVICE_LABELS, not_evaluated: [], core_hash: hashOf(h264.proof), segments: { verified: [0, 1] }, location: LOCATION }, + notes: 'Vector 175 **cut at the end**: GOP 2 removed from the video track, and with it the audio frames §5 assigns to segment 2; the 473 ms empty edit, the timescales and the full proof stay. Segment 1 is the last segment of this file and was not the last of the original: its `end_n` is its last sample\'s DTS plus that sample\'s duration, which in the original was the DTS of IDR 2 — the same number, because a sample table has no other way to place IDR 2 — and its audio runs "to the end of the track", which is now the frames before IDR 2. The record reads back identical. A reader that took `end_n` from the track\'s end — the `mdhd` duration, which on this device counts the 473 ms delay and which `remux.ts` leaves at the original\'s — gets segment 1 wrong here.\n\nThe video\'s media edit is the kept media rounded down into the 10 kHz movie timescale, so it ends less than one movie tick before segment 1 does — the slack §5 *Timing* allows, because a muxer has to round. **Verified clip**, 0 and 1 of 3. The cut at the start is vector 89, 1 and 2 of 3, with its timing kept.' }) + } + + { + // Segment 2's sixth frame held for two more seconds. The last segment + // takes its audio "to the end of the track", so no frame moves between + // segments and every content_hash still matches. + const frozen = (gops[2] as { first: number }).first + 5 + const freeze = remux(h264.media, { + movieTimescale: 90000, + video: { ...clipPlan, delay: videoDelay, retime: (d, i) => i === frozen ? d + 180000 : d }, + audio: { samples: keptAudioIndexes, delay: audioDelay } + }) + timed({ name: '179-mp4-timing-clip-frame-frozen', file: Buffer.concat([freeze, h264.trailer]), proof: h264.proof, + expected: RETIMED, + notes: 'Vector 89\'s clip with one `stts` duration lengthened by two seconds: the sixth frame of segment 2 freezes on screen, then the recording resumes. Every sample, every vcap SEI and every audio frame is where it was, segment 2 is the last of the file so its audio still runs to the end of the track, and both GOPs recompute to their signed `content_hash` — before corpus 7.0.0 this file read *verified clip*, 1 and 2 of 3, with two seconds of a moment that never lasted two seconds.\n\nSegment 2\'s timing record read back has one `dts_i − dts_0` after the frozen frame larger by 180 000 ticks, and `end_n` with them: its hash is not the entry\'s. The signed frames under a timing nobody signed — **frames not compared**, *timing differs*, no segment credited (§5 *Timing*). Not *tampered*: re-muxing a clip is not an accusation.' }) + } + + { + // Two frames of segment 2 shown in each other's place: frame p at the + // instant of p+1 and p+1 at the instant of p, by composition offsets. + const order = clipPlan.samples + const p = (gops[1] as { count: number }).count + 3 + const step = Number((video[order[p] as number] as { duration: bigint }).duration) + const reordered = remux(h264.media, { + movieTimescale: 90000, + video: { ...clipPlan, delay: videoDelay, cts: order.map((_, n) => n === p ? step : n === p + 1 ? -step : 0) }, + audio: { samples: keptAudioIndexes, delay: audioDelay } + }) + timed({ name: '180-mp4-timing-clip-frames-reordered', file: Buffer.concat([reordered, h264.trailer]), proof: h264.proof, + expected: RETIMED, + notes: `Vector 89's clip with a \`ctts\` box added (version 1) that swaps the presentation of two frames inside segment 2: the clip's sample ${p} is shown ${step} ticks late and sample ${p + 1} ${step} ticks early, so a player shows them in each other's place. Decode order, every sample, every SEI and every audio frame are untouched; both GOPs recompute. Picture order count would catch this in a stream with B-frames, and neither sealer writes any: on their files there was nothing to check it against.\n\nSegment 2's record reads back with two \`cts_i\` that are not 0, where the signed record has 0 for every sample (the original has no \`ctts\`): **frames not compared**, *timing differs*, nothing credited (§5 *Timing*).` }) + } + + { + // Both media timescales doubled, every duration kept: twice as fast, + // in sync. The movie timescale is doubled with them, so every empty + // edit is half as long and every instant exactly half what it was — + // §5 assigns the same audio frames to each segment. + const doubled = remux(h264.media, { + movieTimescale: 180000, + video: { ...clipPlan, delay: videoDelay, timescale: 180000 }, + audio: { samples: keptAudioIndexes, delay: audioDelay, timescale: 96000 } + }) + timed({ name: '181-mp4-timing-clip-timescale-doubled', file: Buffer.concat([doubled, h264.trailer]), proof: h264.proof, + expected: RETIMED, + notes: 'Vector 89\'s clip with both tracks\' `mdhd` timescales doubled (video 180 000, audio 96 000) and every `stts` duration kept, and the movie timescale doubled with them: the whole clip plays twice as fast, picture and sound in sync. Every instant on the presentation timeline is exactly half what it was, so §5 assigns the same audio frames to each segment and both GOPs recompute — the uniform rescale the audio rule could never see.\n\nRead back, the values are the signed ones, in a timescale that says they last half as long. Converted to the signed timescales, `t × 90 000 / 180 000` is not an integer for an odd duration (3001, 2999), and where it is it is half the signed value: either way the hash differs — **frames not compared**, *timing differs* (§5 *Timing*). Vector 182 is the re-mux that changes the timescale and keeps the instants.' }) + } + + { + // Every duration and both timescales multiplied by 2: the same + // instants in finer ticks, what a re-muxer that rescales does. + const finer = remux(h264.media, { + movieTimescale: 90000, + video: { ...clipPlan, delay: videoDelay, timescale: 180000, retime: (d) => d * 2 }, + audio: { samples: keptAudioIndexes, delay: audioDelay, timescale: 96000, retime: (d) => d * 2 } + }) + timed({ name: '182-mp4-timing-clip-exact-remux', file: Buffer.concat([finer, h264.trailer]), proof: h264.proof, + expected: { outcome: 'verified_clip', labels: DEVICE_LABELS, not_evaluated: [], core_hash: hashOf(h264.proof), segments: { verified: [1, 2] }, location: LOCATION }, + notes: 'Vector 89\'s clip re-muxed into finer ticks: both `mdhd` timescales doubled (video 180 000, audio 96 000) **and** every `stts` duration doubled with them, the empty edits unchanged. Every frame is shown at the instant it was, for as long as it was. A verifier converts each value read back into the signed timescale — `t_signed = t_received × ts_signed / ts_received`, here `2t × 90 000 / 180 000 = t`, an integer every time — and the records hash to the signed ones. **Verified clip**, 1 and 2 of 3: a re-mux that keeps or multiplies a timescale verifies exactly (§5 *Timing*), and only one that cannot represent the original instants reads *timing differs*.' }) + } + + { + // The AudioSpecificConfig's sampling frequency index, 3 (48 kHz) → 4 + // (44.1 kHz), in the clip's esds: same length, nothing else moves. + const retuned = Buffer.from(cut) + const esds = retuned.indexOf(Buffer.from('esds', 'latin1')) + const asc = retuned.indexOf(Buffer.from('05021188', 'hex'), esds) + if (esds < 0 || asc < 0 || asc > esds + 64) throw new Error('183: no 48 kHz AAC AudioSpecificConfig in the clip') + retuned.writeUInt16BE(0x1208, asc + 2) + timed({ name: '183-mp4-timing-clip-audio-rate-changed', file: Buffer.concat([retuned, h264.trailer]), proof: h264.proof, + expected: { outcome: 'frames_not_compared', labels: [...DEVICE_LABELS, 'presentation differs'].sort(), not_evaluated: [], core_hash: hashOf(h264.proof), segments: { verified: [] }, location: LOCATION }, + notes: `Vector 89's clip with the AudioSpecificConfig inside the audio sample entry's \`esds\` changed from 48 kHz to 44.1 kHz (sampling frequency index 3 → 4, file byte ${asc + 2}): the same coded frames now decode 8 % slower and lower in pitch, while every \`stts\` duration, every timescale and every byte a segment hashes are untouched — the timing record reads back identical. What a decoder is told about the audio is presentation: since corpus 7.0.0 the audio sample entry's \`esds\` is part of \`X\` in \`media.presentation.config\` (§5 *Presentation*), so the configuration hash read back differs — **frames not compared**, *presentation differs*, nothing credited.` }) + } + + { + // The video's media edit ends 0.2 s before the media does: inside + // segment 2 (twelve frames, 0.4 s), which a player now shows in part. + const media = clipPlan.samples.reduce((n, i) => n + (video[i] as { duration: bigint }).duration, 0n) + const trimmed = remux(h264.media, { + movieTimescale: 90000, + video: { ...clipPlan, edits: [{ duration: videoDelay, mediaTime: -1n }, { duration: media - 18000n, mediaTime: 0n }] }, + audio: { samples: keptAudioIndexes, delay: audioDelay } + }) + timed({ name: '184-mp4-timing-clip-edit-trims-segment', file: Buffer.concat([trimmed, h264.trailer]), proof: h264.proof, + expected: RETIMED, + notes: 'Vector 89\'s clip with the video track\'s single media edit shortened by 0.2 s: `segment_duration` ends inside segment 2, so a player stops showing it six frames early. The edit list keeps the shape §5 models — leading empty edit, one media edit at rate 1 — so every GOP is located and recomputes, and every timing record reads back as signed: the sample tables are vector 89\'s. What changed is how much of segment 2 is shown.\n\n§5 *Timing*: on a clip, a single media edit that starts after a located segment\'s first presented instant, or ends one movie tick or more before its last frame does, trims inside it — a subset of the signed frames under a timing nobody signed. **Frames not compared**, *timing differs*. An original is not read this way: `media.hash` covers its edit list with every other byte.' }) + } + + { + // A writer that signed the encoder's microsecond timestamps instead of + // the muxer's ticks: video_timescale and audio_timescale 1 000 000, every + // value rounded to the nearest microsecond. Consistent with itself — + // the root is over the entries — and not a description of the file. + const reading = readContainer(h264.media) as Extract, { kind: 'gops' }> + const us = (ts: bigint) => (v: bigint): bigint => (v * 1000000n + ts / 2n) / ts + const records = [0, 1, 2].map((n) => { + const t = (reading.gops.find((g) => g.index === n) as { timing: TimingValues }).timing + const v = us(reading.timescales.video) + const a = us(reading.timescales.audio as bigint) + return timingRecord({ videoDts: t.videoDts.map(v), videoCts: t.videoCts.map(v), videoEnd: v(t.videoEnd), audioDts: t.audioDts.map(a), audioDur: t.audioDur.map(a) }) + }) + const hashes = records.map((r) => createHash('sha256').update(r).digest()) + const misdescribed = resignedProof(h264Device, presentationOf(h264.media), { timing: { video_timescale: 1000000, audio_timescale: 1000000, root: timingRoot(hashes).toString('base64url') }, hashes, records }) + timed({ name: '185-mp4-timing-original-misdescribed', file: seal(h264.media, misdescribed), proof: misdescribed, + expected: { outcome: 'authentic', labels: [...DEVICE_LABELS, 'timing differs'].sort(), not_evaluated: [], core_hash: hashOf(misdescribed), segments: { verified: [0, 1, 2] }, location: LOCATION }, + notes: 'Vector 175\'s file under a core whose `media.timing` was computed from the encoder\'s presentation timestamps in microseconds — `video_timescale` and `audio_timescale` 1 000 000, every value rounded to the microsecond — instead of from the ticks the muxer wrote: the mistake §5\'s writer requirements forbid, made by a writer that hashed before muxing. The proof is consistent with itself (the root recomputes from the entries) and does not describe the file: converted into microseconds, `3000 × 1 000 000 / 90 000` is not an integer, so no segment\'s record reads back as signed.\n\nThe bytes are exactly the sealed ones — `media.hash` matches — so the outcome stays **authentic**, and the false claim is the writer\'s: *timing differs*, amber at best, the way vector 163 is *presentation differs* (§5 *Timing*, §7). A writer conformance suite catches it on its first file.' }) + } + + { + // The full proof minus entry 0, beside a clip that lacks GOP 0: the + // proof a cutter that "cleans up" the entries of absent segments makes. + const proof = { ...h264.proof, segments: (h264.proof.segments as unknown as SegmentEntry[]).slice(1) as unknown as Json } + timed({ name: '186-mp4-timing-clip-entry-dropped', file: seal(cut, proof), proof, + expected: RETIMED, + notes: 'Vector 89\'s clip — GOP 0 cut — with entry 0 dropped from the proof as well: the proof a cutter makes when it keeps only the entries of the segments it kept. Every remaining signature holds, GOPs 1 and 2 are located and recompute, and their timing reads back as their entries say. But the entries\' `timing` hashes are outside every signature: only `media.timing.root` binds them, and the root is over all `segment_count` of them. With entry 0 gone it cannot be recomputed, so nothing shows entries 1 and 2 are the ones the sealer wrote — anyone could have rewritten them to match a re-timed clip.\n\n§5 *Timing*: a clip\'s proof carries every entry, and a located segment whose timing hash is not authenticated by the root is not shown at signed instants — **frames not compared**, *timing differs*. Before corpus 7.0.0 this file read *verified clip*, 1 and 2 of 3, as vector 89 does. Vector 38 drops the same entry over the original file and reads *tampered* for an earlier reason: GOP 0 is in the file and nothing signs it.' }) + } + + { + // Entry 1's timing removed after signing. + const entries = (h264.proof.segments as unknown as SegmentEntry[]).map((e) => { if (e.gop !== 1) return e; const { timing: _t, ...rest } = e; return rest }) + const proof = { ...h264.proof, segments: entries as unknown as Json } + timed({ name: '187-mp4-timing-entry-hash-missing', file: seal(h264.media, proof), proof, + expected: { outcome: 'no_proof_found', labels: [], not_evaluated: [] }, + schemaValid: false, + notes: 'Vector 175 with the `timing` member removed from segment 1\'s entry after signing. §6.1 makes it a required member of every `segments[]` entry, as `hash`, `prev` and `sig` are: a proof whose entry lacks it is not well formed — **no proof found**, before any signature is read, the answer a missing `media.w` gets after signing (vector 46).' }) + } } { @@ -648,20 +878,20 @@ const videoCore = (media: Buffer, extra: Proof = {}): Proof => photoCore(media, const presented = (presentation: Json): Proof => resignedProof(hevcDevice, presentation) const proof = hevc.proof const LABELS = ['integrity unevaluated', 'key not in transparency log', 'no trusted time', 'no watermark', 'not anchored', 'origin not hardware-attested'] - const testKey = 'The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation`.' + const testKey = 'The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation` and `media.timing` (no audio track, so no `audio_timescale`).' const presentationVector = (name: string, bytes: Buffer, expected: FileVector['expected'], notes: string, signed: Proof = proof): void => file({ name, container: true, ext: 'mp4', file: bytes, proof: signed, expected, notes: `${notes}\n\n${testKey}` }) presentationVector('158-mp4-presentation-original', seal(hevc.media, proof), { outcome: 'authentic', labels: LABELS, not_evaluated: [], core_hash: hashOf(proof), segments: { verified: [0, 1, 2] } }, - 'Vector 37\'s file with a core that carries `media.presentation` (§6.1): the SHA-256 of the presentation message over the `hvcC` parameter sets — VPS, SPS, PPS, in NAL type order — and the sample entry\'s `clap`, `pasp` and `colr` boxes (this file has none), the video `tkhd` matrix (identity) and its display size, 640×360 in 16.16. **Authentic**: an original is covered whole by `media.hash`, and the presentation read back from it is the signed one.') + 'Vector 37\'s file with a core that carries `media.presentation` (§6.1): the SHA-256 of the presentation message over the `hvcC` parameter sets — VPS, SPS, PPS, in NAL type order — and the sample entry\'s `clap`, `pasp` and `colr` boxes (this file has a `colr`, `nclx`, the one `MediaMuxer` wrote), the video `tkhd` matrix (identity) and its display size, 640×360 in 16.16. **Authentic**: an original is covered whole by `media.hash`, and the presentation and the timing read back from it are the signed ones.') // GOP 0 cut; no audio track, so no delay is needed to keep instants. const gops = gopsOf(hevc.media) const clip = remux(hevc.media, { video: { samples: gops.slice(1).flatMap(range), sync: 'keep' } }) presentationVector('159-mp4-presentation-clip', Buffer.concat([clip, buildTrailer(jcs(proof as Json), { flags: flagsFor(proof) })]), { outcome: 'verified_clip', labels: LABELS, not_evaluated: [], core_hash: hashOf(proof), segments: { verified: [1, 2] } }, - 'Vector 158 cut: GOP 0 dropped from the sample tables by `remux.ts`, which copies the track header and the sample description as they were. Both remaining GOPs are located and recompute, and the clip presents them exactly as the core says — the same parameter sets, the same matrix, the same display size, one video track. **Verified clip**, 1 and 2 of 3: the case §5 *Presentation* must leave alone.') + 'Vector 158 cut: GOP 0 dropped from the sample tables by `remux.ts`, which copies the track header and the sample description as they were. Both remaining GOPs are located and recompute, and the clip presents them exactly as the core says — the same parameter sets, the same matrix, the same display size, one video track, the same timing records (a silent file: `media.timing` has no `audio_timescale`, and every record has `a = 0`). **Verified clip**, 1 and 2 of 3: the case §5 *Presentation* must leave alone.') // The clip's moov, rewritten in place: lengths never change. const moovOf = (b: Buffer): Box => find(boxes(b, 0, b.length), 'moov') as Box @@ -2348,7 +2578,8 @@ for (const vector of vectors) { ...(vector.keyStatus ? { key_status: vector.keyStatus } : {}), ...(vector.chainRead ? { chain_read: vector.chainRead } : {}), ...vector.expected, - ...(vector.proof ? { schema_valid: schemaValid } : {}) + ...(vector.proof ? { schema_valid: schemaValid } : {}), + ...(vector.debug ? { debug: vector.debug } : {}) }, null, 2) + '\n') actual = pick(verifyFile({ file: vector.file, sidecar: vector.sidecar, recomputeSegments: vector.container === true, trust, clock: vector.verifierClock ? new Date(vector.verifierClock) : undefined, keyStatus: vector.keyStatus as KeyStatusStatement | undefined, chainRead: vector.chainRead as ChainRead | undefined }), vector.expected) // The schema must agree with the review too: a proof the review calls diff --git a/tools/src/make-c2pa-vectors.ts b/tools/src/make-c2pa-vectors.ts index 5eb68ce..145115f 100644 --- a/tools/src/make-c2pa-vectors.ts +++ b/tools/src/make-c2pa-vectors.ts @@ -286,9 +286,9 @@ const photo = proofOf('01-jpeg-sealed') const sealedJpeg = readVector('01-jpeg-sealed', 'input.jpg') const timestamped = proofOf('59-jpeg-timestamped') // Vector 166: vector 36's device container under the re-signed core that -// carries media.presentation (corpus 5.0.0). The device proof of 36 predates -// that required field, so a clip of it would read no proof found and test -// nothing else. 89 is the cut of the same container under the same core. +// carries media.presentation (corpus 5.0.0) and media.timing (7.0.0). The +// device proof of 36 predates both required fields, so a clip of it would +// read no proof found and test nothing else. 89 is the cut of the same container under the same core. const device = readVector('166-mp4-container-h264-presentation', 'input.mp4') const deviceProof = JSON.parse((parseTrailer(device) as { payload: Buffer }).payload.toString('utf8')) as Proof const cutClip = unsealed(readVector('89-mp4-container-cut-clip', 'input.mp4')) @@ -543,11 +543,11 @@ const withStore = await c2paSign({ asset: baseJpeg, mime: 'image/jpeg', label: l const g0 = await c2paSign({ asset: device, mime: 'video/mp4', label: label(145, 0), proof: deviceProof }) const clipOf = async (n: number, asset: Buffer, actions: string[], o: { parent?: Buffer, proof?: Proof } = {}): Promise => (await c2paSign({ asset, mime: 'video/mp4', label: label(n, 1), parent: { asset: o.parent ?? g0.file, mime: 'video/mp4' }, actions, proof: o.proof })).file - const provenance = 'The source is vector 166: the container of vector 36\'s Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device\'s, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0); the clip bytes are vector 89\'s cut of it, under the same core. Rebuilt in corpus 6.0.0: the 5.0.0 files carried vector 36\'s device proof, which predates the field and read *no proof found*.' + const provenance = 'The source is vector 166: the container of vector 36\'s Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device\'s, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0) and `media.timing`, with each segment entry\'s timing hash (corpus 7.0.0); the clip bytes are vector 89\'s cut of it, under the same core. Rebuilt in corpus 6.0.0, when the 5.0.0 files carried vector 36\'s device proof, which predates `media.presentation`, and again in 7.0.0 over the core that binds timing.' add({ name: '145-mp4-c2pa-clip-parent-of', ext: 'mp4', kind: 'container', file: await clipOf(145, cutClip, ['c2pa.trimmed']), proof: deviceProof, expected: { outcome: 'verified_clip', labels: DEVICE_LABELS, not_evaluated: [], core_hash: hashOf(deviceProof), segments: { verified: [1, 2] }, proof_source: src(1, label(145, 0)), frames_name_capture: true }, - notes: `A clip made by a C2PA-aware cutter: vector 89's cut of vector 166 — GOP 0 removed, no re-encoding, the vcap SEIs intact — with no trailer, signed with a manifest that opens the source as \`parentOf\` and records \`c2pa.trimmed\`. The source's manifest (generation 0, ${label(145, 0)}) carries vector 166's proof and travels in the clip's store as its ingredient.\n\nNo footer, no proof at depth 0, no sidecar: the proof is found at depth 1 (§3.2), the nearest ancestor that carries one. The frames name the capture (\`frames_name_capture\`, a locating hint), GOPs 1 and 2 are located and recompute under §5, the core binds the presentation the clip still has (§5 *Presentation*), and the outcome is **verified clip**, 1 and 2 of 3 — vector 89's verdict, reached without a trailer. ${provenance}` }) + notes: `A clip made by a C2PA-aware cutter: vector 89's cut of vector 166 — GOP 0 removed, no re-encoding, the vcap SEIs intact — with no trailer, signed with a manifest that opens the source as \`parentOf\` and records \`c2pa.trimmed\`. The source's manifest (generation 0, ${label(145, 0)}) carries vector 166's proof and travels in the clip's store as its ingredient.\n\nNo footer, no proof at depth 0, no sidecar: the proof is found at depth 1 (§3.2), the nearest ancestor that carries one. The frames name the capture (\`frames_name_capture\`, a locating hint), GOPs 1 and 2 are located and recompute under §5, the core binds the presentation and the timing the clip still has (§5 *Presentation*, *Timing*), and the outcome is **verified clip**, 1 and 2 of 3 — vector 89's verdict, reached without a trailer. ${provenance}` }) { // One byte of the last GOP's IDR slice data changed, then signed by a @@ -574,11 +574,13 @@ const withStore = await c2paSign({ asset: baseJpeg, mime: 'image/jpeg', label: l // so every signature in it holds and no GOP of the clip names it. const capture = Buffer.alloc(16, 0x71) let previous: Buffer | null = null - const segments = (deviceProof.segments as Array<{ gop: number, hash: string, sig: string }>).map((seg) => { + const segments = (deviceProof.segments as Array<{ gop: number, hash: string, sig: string, timing: string }>).map((seg) => { const prev = previous ? linkOf(previous) : ZERO_LINK const message = segmentMessage(capture, seg.gop, Buffer.from(seg.hash, 'base64url'), prev) previous = message - return { gop: seg.gop, hash: seg.hash, prev: prev.toString('base64url'), sig: signEs256(message, testKey).toString('base64url') } + // The timing hashes stay vector 166's: outside the message, bound by + // the same media.timing.root the foreign core carries. + return { gop: seg.gop, hash: seg.hash, prev: prev.toString('base64url'), sig: signEs256(message, testKey).toString('base64url'), timing: seg.timing } }) const foreign = resign({ ...deviceProof, capture_id: capture.toString('base64url'), segments: segments as unknown as Json }) add({ name: '171-mp4-c2pa-foreign-proof-sidecar', ext: 'mp4', kind: 'container', file: (await c2paSign({ asset: cutClip, mime: 'video/mp4', label: label(171, 1), proof: foreign })).file, sidecar: jcs(deviceProof as Json), proof: deviceProof, diff --git a/tools/src/remux.ts b/tools/src/remux.ts index 23b5c06..d395855 100644 --- a/tools/src/remux.ts +++ b/tools/src/remux.ts @@ -37,6 +37,16 @@ export interface TrackPlan { replace?: Map /** `stss`: keep the sync flags of the original samples, or mark every sample. */ sync?: 'keep' | 'all' + /** + * §5 *Timing* edits. `timescale` rewrites the track's `mdhd` timescale (and + * its duration, in the new ticks); `retime` gives a sample's new `stts` + * duration from its original one and original index; `cts` writes a + * version-1 `ctts` with one composition offset per sample of the new order. + * The source files carry no `ctts`, and without `cts` none is written. + */ + timescale?: number + retime?: (duration: number, index: number) => number + cts?: number[] } export interface Plan { @@ -82,7 +92,7 @@ const syncOf = (file: Buffer, stbl: Box, count: number): Set => { const tablesFor = (file: Buffer, stbl: Box, plan: TrackPlan, offsets: number[]): Buffer => { const kids = children(file, stbl) const samples = samplesOf(file, stbl) - const durations = durationsOf(file, stbl) + const durations = durationsOf(file, stbl).map((d, i) => plan.retime ? plan.retime(d, i) : d) const sync = syncOf(file, stbl, samples.length) const sizes = plan.samples.map((i) => plan.replace?.get(i)?.length ?? (samples[i] as { size: number }).size) @@ -94,6 +104,10 @@ const tablesFor = (file: Buffer, stbl: Box, plan: TrackPlan, offsets: number[]): else runs.push([1, delta]) } const stts = fullBox('stts', u32(runs.length), ...runs.flatMap(([count, delta]) => [u32(count), u32(delta)])) + if (plan.cts && plan.cts.length !== plan.samples.length) throw new Error('remux: one composition offset per sample') + const ctts = plan.cts + ? [box('ctts', Buffer.from([1, 0, 0, 0]), u32(plan.cts.length), ...plan.cts.flatMap((offset) => { const b = Buffer.alloc(4); b.writeInt32BE(offset); return [u32(1), b] }))] + : [] const stsz = fullBox('stsz', u32(0), u32(sizes.length), ...sizes.map(u32)) const stsc = fullBox('stsc', u32(1), u32(1), u32(1), u32(1)) const co64 = fullBox('co64', u32(offsets.length), ...offsets.map((o) => { @@ -104,7 +118,7 @@ const tablesFor = (file: Buffer, stbl: Box, plan: TrackPlan, offsets: number[]): const synced = plan.samples.map((i, n) => (plan.sync === 'all' || sync.has(i)) ? n + 1 : 0).filter((n) => n > 0) const stss = find(kids, 'stss') || plan.sync === 'all' ? [fullBox('stss', u32(synced.length), ...synced.map(u32))] : [] const stsd = find(kids, 'stsd') as Box - return box('stbl', file.subarray(stsd.start, stsd.end), stts, ...stss, stsz, stsc, co64) + return box('stbl', file.subarray(stsd.start, stsd.end), stts, ...ctts, ...stss, stsz, stsc, co64) } const elstFor = (delay: bigint, duration: bigint): Buffer => @@ -165,6 +179,15 @@ export const remux = (file: Buffer, plan: Plan): Buffer => { const trackKind = codecOf(file, find(children(file, stbl), 'stsd') as Box).kind const own = trackKind === 'video' ? plan.video : trackKind === 'audio' ? plan.audio : undefined parts.push(rebuiltTrak(child, own, trackKind === 'other' ? null : trackKind)) + } else if (child.type === 'mdhd' && trackPlan?.timescale !== undefined) { + // A new media timescale, and the track's duration in it. + if (file[child.payload] !== 0) throw new Error('remux: only version 0 mdhd') + const stbl = find(children(file, find(children(file, container), 'minf') as Box), 'stbl') as Box + const durations = durationsOf(file, stbl).map((d, i) => trackPlan.retime ? trackPlan.retime(d, i) : d) + const copy = Buffer.from(file.subarray(child.start, child.end)) + copy.writeUInt32BE(trackPlan.timescale, 8 + 12) + copy.writeUInt32BE(trackPlan.samples.reduce((n, i) => n + (durations[i] as number), 0), 8 + 16) + parts.push(copy) } else if (child.type === 'stbl' && trackPlan && kind) { parts.push(tablesFor(file, child, trackPlan, layout(child, trackPlan, moovSize))) } else if (child.type === 'minf') { @@ -178,7 +201,7 @@ export const remux = (file: Buffer, plan: Plan): Buffer => { const rebuiltTrak = (trak: Box, trackPlan: TrackPlan | undefined, kind: 'video' | 'audio' | null): Buffer => { const parts: Buffer[] = [] const mdhd = find(children(file, find(children(file, trak), 'mdia') as Box), 'mdhd') as Box - const mediaScale = BigInt(file.readUInt32BE(mdhd.payload + 12)) + const mediaScale = BigInt(trackPlan?.timescale ?? file.readUInt32BE(mdhd.payload + 12)) for (const child of children(file, trak)) { if (child.type === 'edts') { // Replaced when the plan says where the track starts; otherwise @@ -191,11 +214,12 @@ export const remux = (file: Buffer, plan: Plan): Buffer => { if (child.type === 'mdia') { if (trackPlan && kind) { const stbl = find(children(file, find(children(file, child), 'minf') as Box), 'stbl') as Box - const durations = durationsOf(file, stbl) + const durations = durationsOf(file, stbl).map((d, i) => trackPlan.retime ? trackPlan.retime(d, i) : d) const media = trackPlan.samples.reduce((n, i) => n + BigInt(durations[i] as number), 0n) - // The delay has to be exact; the duration of the edit that follows - // it is informative (§5 reads where a track starts, not how long - // the edit claims it lasts), so it is rounded down. + // The delay has to be exact. The duration of the media edit that + // follows it is rounded down into the movie timescale, as a muxer + // has to: §5 *Timing* allows an edit to end less than one movie + // tick before the media does. if (trackPlan.edits) parts.push(elstOf(trackPlan.edits)) else if ((trackPlan.delay ?? 0n) > 0n) parts.push(elstFor(trackPlan.delay as bigint, media * BigInt(newScale) / mediaScale)) } diff --git a/tools/src/segments.ts b/tools/src/segments.ts index 3614b16..828dfb9 100644 --- a/tools/src/segments.ts +++ b/tools/src/segments.ts @@ -24,6 +24,9 @@ export interface SegmentEntry { prev: string // sig(n), base64url P1363 sig: string + // SHA-256(timing(n)), base64url (§5 *Timing*). Outside the 96-byte message: + // bound by media.timing.root in the core. Absent in message-level vectors. + timing?: string } export type ChainStatus = 'complete' | 'clip' | 'tampered' diff --git a/tools/src/timing.ts b/tools/src/timing.ts new file mode 100644 index 0000000..2cd2a26 --- /dev/null +++ b/tools/src/timing.ts @@ -0,0 +1,233 @@ +import { createHash } from 'node:crypto' + +/** + * §5 *Timing*: the timing record of one segment, `timing(n)`, and what a + * verifier does with it. This is the reference the sealers and the verifiers + * port, so it is written to be read: every rule here is a sentence of §5. + * + * Why it exists. A segment's `content_hash` covers NAL units and audio frame + * bytes, and `media.presentation` covers how a player is told to show them; + * neither covers *when* each frame is shown. For an original, `media.hash` + * covers the timing tables with every other byte; for a clip nothing did, so a + * re-mux could freeze a frame (`stts`), reorder frames inside a GOP (`ctts`), + * rescale a track (`mdhd`) or trim a located segment (`elst`) and still read + * *verified clip*. The sealer now hashes this record per segment and signs the + * root of those hashes in the core (`media.timing`). + * + * What this module does NOT do: read a container. `container.ts` walks the + * sample tables, splits GOPs and assigns audio frames by §5's DTS rule, and + * hands each GOP's values to `timingRecord`. Keeping the two apart means the + * byte layout below can be ported and tested on its own. + */ + +/** + * The values of one segment's record, exactly as §5 lists them, each an + * integer in the media timescale of its own track. All "relative" values are + * measured from the segment's own first sample, so the record does not depend + * on where the segment sits in the file — a clip that cut the segments before + * it has the same record as the original. + */ +export interface TimingValues { + /** dts_i − dts_0 for each video sample of the segment, in decode order (the first is 0). */ + videoDts: bigint[] + /** cts_i, the sample's composition offset from `ctts`; 0 when the track has no `ctts`. */ + videoCts: bigint[] + /** + * end_n − dts_0: the DTS of the segment's last video sample plus that + * sample's `stts` duration. In a sample table this is the DTS of the next + * sample (IDR n+1) when there is one; for the last segment it is the only + * definition, and it is what binds the last frame's duration. + */ + videoEnd: bigint + /** adts_j − adts_0 for each audio frame §5 assigns to the segment, in decode order. */ + audioDts: bigint[] + /** adur_j, each audio frame's `stts` duration. */ + audioDur: bigint[] +} + +/** The timescales a record's values are expressed in: the `mdhd` timescale of each track. */ +export interface Timescales { video: bigint, audio: bigint | null } + +const INT64_MIN = -(1n << 63n) +const INT64_MAX = (1n << 63n) - 1n +const UINT64_MAX = (1n << 64n) - 1n +const UINT32_MAX = (1n << 32n) - 1n + +/** Thrown when a value does not fit its field: a record that cannot be encoded is a timing that differs. */ +export class TimingUnencodable extends Error {} + +const int64 = (value: bigint): Buffer => { + if (value < INT64_MIN || value > INT64_MAX) throw new TimingUnencodable(`${value} does not fit int64`) + const out = Buffer.alloc(8) + out.writeBigInt64BE(value) + return out +} + +const uint64 = (value: bigint): Buffer => { + if (value < 0n || value > UINT64_MAX) throw new TimingUnencodable(`${value} does not fit uint64`) + const out = Buffer.alloc(8) + out.writeBigUInt64BE(value) + return out +} + +const uint32 = (value: bigint | number): Buffer => { + const v = BigInt(value) + if (v < 0n || v > UINT32_MAX) throw new TimingUnencodable(`${v} does not fit uint32`) + const out = Buffer.alloc(4) + out.writeUInt32BE(Number(v)) + return out +} + +/** + * The record's bytes (§5): + * + * ``` + * timing(n) = uint32 BE v + * ‖ ( int64 BE (dts_i − dts_0) ‖ int64 BE cts_i ) × v + * ‖ uint64 BE (end_n − dts_0) + * ‖ uint32 BE a + * ‖ ( int64 BE (adts_j − adts_0) ‖ uint32 BE adur_j ) × a + * ``` + * + * Every field is fixed-length and the counts come first, so nothing can shift + * between the video and the audio half. + */ +export const timingRecord = (t: TimingValues): Buffer => { + if (t.videoDts.length !== t.videoCts.length) throw new Error('timing: one composition offset per video sample') + if (t.audioDts.length !== t.audioDur.length) throw new Error('timing: one duration per audio frame') + return Buffer.concat([ + uint32(t.videoDts.length), + ...t.videoDts.flatMap((dts, i) => [int64(dts), int64(t.videoCts[i] as bigint)]), + uint64(t.videoEnd), + uint32(t.audioDts.length), + ...t.audioDts.flatMap((dts, j) => [int64(dts), uint32(t.audioDur[j] as bigint)]) + ]) +} + +const sha256 = (bytes: Buffer): Buffer => createHash('sha256').update(bytes).digest() + +/** `segments[n].timing`: SHA-256 of the record, 32 bytes (base64url in the proof). */ +export const timingHash = (t: TimingValues): Buffer => sha256(timingRecord(t)) + +/** + * `media.timing.root`: SHA-256 over the timing hashes of segments 0 to + * `segment_count − 1`, 32 bytes each, in index order. Not a Merkle tree: a + * clip's proof carries every entry, so a verifier always has all of them, and + * the flat hash is the one two implementations cannot build differently. + */ +export const timingRoot = (hashes: Buffer[]): Buffer => { + if (hashes.some((h) => h.length !== 32)) throw new Error('timing root: every hash is 32 bytes') + return sha256(Buffer.concat(hashes)) +} + +/** + * Expresses received ticks in the timescale the sealer signed: + * `t_signed = t_received × ts_signed / ts_received`, which must be an integer + * for **every** value, or the timing differs and this returns null. + * + * Exact on purpose. A re-mux that keeps a timescale, or multiplies it, maps + * every instant back exactly and verifies; one that moved to a timescale + * unable to represent the original instants has moved them — by at most a + * tick, but moved — and a hash admits no tolerance, which is the point: a + * tolerance would be the thing to argue about. + * + * Audio values need both audio timescales; when a segment has audio frames + * and either side has no audio timescale, there is nothing to convert with. + */ +export const convertTiming = (t: TimingValues, received: Timescales, signed: Timescales): TimingValues | null => { + const scale = (from: bigint | null, to: bigint | null) => (value: bigint): bigint | null => { + if (from === null || to === null || from <= 0n || to <= 0n) return null + const product = value * to + return product % from === 0n ? product / from : null + } + const video = scale(received.video, signed.video) + const audio = scale(received.audio, signed.audio) + const all = (values: bigint[], f: (v: bigint) => bigint | null): bigint[] | null => { + const out: bigint[] = [] + for (const value of values) { + const converted = f(value) + if (converted === null) return null + out.push(converted) + } + return out + } + const videoDts = all(t.videoDts, video) + const videoCts = all(t.videoCts, video) + const videoEnd = video(t.videoEnd) + const audioDts = all(t.audioDts, audio) + const audioDur = all(t.audioDur, audio) + if (videoDts === null || videoCts === null || videoEnd === null || audioDts === null || audioDur === null) return null + return { videoDts, videoCts, videoEnd, audioDts, audioDur } +} + +/** + * The hash of a record read from a received file, in the signed timescales, + * or null when the values cannot be expressed in them (or encoded at all): + * both mean the timing differs. + */ +export const receivedTimingHash = (t: TimingValues, received: Timescales, signed: Timescales): Buffer | null => { + const converted = convertTiming(t, received, signed) + if (converted === null) return null + try { + return timingHash(converted) + } catch (e) { + if (e instanceof TimingUnencodable) return null + throw e + } +} + +/** + * The span of media time a segment occupies on one track, in that track's + * media ticks: from the earliest composition instant of its samples to the + * latest instant one of them ends. Audio has no composition offsets, so its + * span is from its first frame's DTS to its last frame's DTS plus duration. + */ +export interface Extent { start: bigint, end: bigint } + +/** The single media edit §5 models: where the track's media starts, and for how long it is shown. */ +export interface MediaEdit { + /** `media_time`, in the track's media ticks. */ + mediaTime: bigint + /** `segment_duration`, in movie ticks. */ + duration: bigint + movieTimescale: bigint + mediaTimescale: bigint +} + +/** + * Whether the single media edit trims inside a segment's extent on one track + * (§5 *Timing*, clips only). The edit shows media from `media_time` for + * `segment_duration` movie ticks; a segment whose span starts before + * `media_time`, or ends one movie tick or more after the edit does, is shown + * in part — a subset of the signed frames, under a timing nobody signed. + * + * The end gets one movie tick of slack because a muxer has to round the + * edit's duration into the movie timescale, which is usually coarser than the + * media's: `(d + 1) × T ≤ (e − m) × M` is "the edit ends a whole movie tick or + * more before the segment does", in integers. + */ +export const editTrims = (edit: MediaEdit, extent: Extent): boolean => { + if (edit.mediaTime > extent.start) return true + return (edit.duration + 1n) * edit.mediaTimescale <= (extent.end - edit.mediaTime) * edit.movieTimescale +} + +/** The video span of a segment from its record: earliest composition instant to the latest end. */ +export const videoExtent = (t: TimingValues, dts0: bigint): Extent => { + let start: bigint | null = null + let end: bigint | null = null + t.videoDts.forEach((dts, i) => { + const next = t.videoDts[i + 1] ?? t.videoEnd + const shown = dts + (t.videoCts[i] as bigint) + const until = shown + (next - dts) + if (start === null || shown < start) start = shown + if (end === null || until > end) end = until + }) + return { start: dts0 + (start ?? 0n), end: dts0 + (end ?? t.videoEnd) } +} + +/** The audio span of a segment from its record, or null when it has no audio frame. */ +export const audioExtent = (t: TimingValues, adts0: bigint): Extent | null => { + const last = t.audioDts.length - 1 + if (last < 0) return null + return { start: adts0, end: adts0 + (t.audioDts[last] as bigint) + (t.audioDur[last] as bigint) } +} diff --git a/tools/src/verify.ts b/tools/src/verify.ts index afd3b9d..4c8f3fe 100644 --- a/tools/src/verify.ts +++ b/tools/src/verify.ts @@ -6,6 +6,7 @@ import { Flag } from './trailer.js' import { type ProofSource, extractProof } from './carrier.js' import { type SegmentEntry, verifyChain } from './segments.js' import { type ContainerReading, ContainerMalformed, readContainer } from './container.js' +import { type Timescales, editTrims, receivedTimingHash, timingRoot } from './timing.js' import { RANK, leafSpki, normalSerial, validateChain } from './attestation.js' import { type TrustBundle, type TrustedLog } from './trust.js' import { type IntegrityAttachment, type KeyStatusStatement, type RegistryAttachment, verifyIntegrity, verifyKeyStatus, verifyRegistry } from './registry.js' @@ -117,6 +118,18 @@ const presentationShape = (v: unknown): boolean => { Array.isArray(v.display) && v.display.length === 2 && v.display.every(uint32) } +/** + * §6.1 `media.timing`: `{ video_timescale, audio_timescale?, root }`, the + * timescales positive uint32 and `audio_timescale` absent — never null, never + * 0 — when the sealed file has no audio track. + */ +const timingShape = (v: unknown): boolean => { + if (!isObject(v)) return false + const timescale = (x: unknown): boolean => Number.isInteger(x) && (x as number) >= 1 && (x as number) <= 0xffffffff + const known = Object.keys(v).every((k) => k === 'video_timescale' || k === 'audio_timescale' || k === 'root') + return known && timescale(v.video_timescale) && (!('audio_timescale' in v) || timescale(v.audio_timescale)) && b64urlLen(v.root, 32) +} + // The shape checks the verifier needs before it can trust the types it reads; // `schema/` formalizes the rest. const shapeProblem = (proof: Proof): string | null => { @@ -140,8 +153,14 @@ const shapeProblem = (proof: Proof): string | null => { // sets, a matrix or tracks nobody signed; a core that omits it is missing // a required field like any other, not a weaker clip. if (!('presentation' in proof.media)) return 'media.presentation missing' + // §6.1 `media.timing`: required wherever segments are, for the reason + // presentation is — a clip's timing is held against it — and every entry + // carries the hash of its own segment's timing record. + if (!('timing' in proof.media)) return 'media.timing missing' + if (!proof.segments.every((e) => isObject(e) && b64urlLen(e.timing, 32))) return 'segments[].timing missing or malformed' } if ('presentation' in proof.media && !presentationShape(proof.media.presentation)) return 'media.presentation malformed' + if ('timing' in proof.media && !timingShape(proof.media.timing)) return 'media.timing malformed' if (hasNonInteger(coreObject(proof))) return 'floating-point number in the core' return null } @@ -389,6 +408,16 @@ const judge = ( // A segment whose signature fails is not verified, whatever its bytes. segments = { verified: binding.located ? binding.verified.filter((index) => chain.verified.includes(index)) : [] } if (chain.status === 'tampered') return { ...tampered(chain.reason ?? 'segment chain'), segments } + // §5 *Timing*: the entries' timing hashes are outside every signature, + // and the signed root is what binds them. With every entry present it + // recomputes, and a root that does not is a binding the proof makes that + // does not hold — no demuxer needed. With an entry missing it cannot be + // recomputed and the entries' timing is not authenticated (below). + const signedTiming = (proof.media as Proof).timing as { video_timescale: number, audio_timescale?: number, root: string } + const timingAuthenticated = timingEntriesComplete(entries, mediaObj.segment_count as number) + if (timingAuthenticated && entriesRoot(entries).toString('base64url') !== signedTiming.root) { + return { ...tampered('the segments\' timing hashes do not recompute media.timing.root'), segments } + } if (binding.located && binding.problems.length > 0) return { ...tampered(binding.problems.join('; ')), segments } // §5 *Presentation*: what the core signs about how the frames are shown. @@ -410,9 +439,16 @@ const judge = ( const unbound = read?.layout ? 'tracks not bound' : read && presentationDiffers(signed, read.presentation) ? 'presentation differs' : null - if (unbound !== null) { - labels.push(unbound) - return { outcome: 'frames_not_compared', labels: labels.sort(), not_evaluated: notEvaluated, core_hash: hash, segments: { verified: [] }, location, reason: `media.hash does not match and the presentation is not the signed one (${unbound})` } + // §5 *Timing*: and not unless it shows them at the instants the core + // binds — re-timed, reordered, rescaled or trimmed frames are the signed + // frames under a timing nobody signed. Never *tampered*: re-muxing is + // not an accusation. + const retimed = read ? clipTimingProblem(read, signedTiming, entries, segments.verified, timingAuthenticated) : null + if (unbound !== null || retimed !== null) { + if (unbound !== null) labels.push(unbound) + if (retimed !== null) labels.push('timing differs') + const why = [unbound !== null ? `the presentation is not the signed one (${unbound})` : null, retimed].filter((r) => r !== null).join('; ') + return { outcome: 'frames_not_compared', labels: labels.sort(), not_evaluated: notEvaluated, core_hash: hash, segments: { verified: [] }, location, reason: `media.hash does not match and ${why}` } } return { outcome: 'verified_clip', labels: labels.sort(), not_evaluated: notEvaluated, core_hash: hash, segments, location, reason: 'media.hash does not match the received file' } } @@ -420,6 +456,10 @@ const judge = ( // byte, so a signed presentation that does not describe it is the // writer's false claim about its own file — flagged, amber, never red. if (read && presentationDiffers(signed, read.presentation)) labels.push('presentation differs') + // The same for timing: `media.hash` covers every timing table of the + // original, so a root that its own segments do not reproduce is the + // writer's false claim — *timing differs*, amber at best. + if (read && originalTimingDiffers(read, signedTiming, captureId, mediaObj.segment_count as number)) labels.push('timing differs') // media.hash matches: these are the bytes the device sealed. A chain with // segments missing from the proof is still a clip of the proof, and says // so even over the original file. @@ -596,7 +636,7 @@ const level = ( const amberCauses = ['inconsistent claim', 'chain revocation not checked', 'revocation not checked', 'attestation chain expired, capture time not proven', 'registry evidence invalid', 'attestation app not checked', 'attestation app not admitted', 'integrity failed', - 'integrity not proven', 'presentation differs'] + 'integrity not proven', 'presentation differs', 'timing differs'] const green = proven !== 'none' && registry.ok && registry.beforeCapture && (source === 'timestamp' || source === 'anchor') && !amberCauses.some((cause) => labels.includes(cause)) @@ -890,6 +930,71 @@ const presentationDiffers = (signed: { config: string, matrix: number[], display read.matrix.some((value, i) => value !== signed.matrix[i]) || read.display.some((value, i) => value !== signed.display[i]) +/** §5 *Timing*: the timescales a core signs, in the shape `timing.ts` converts with. */ +const signedTimescales = (signed: { video_timescale: number, audio_timescale?: number }): Timescales => + ({ video: BigInt(signed.video_timescale), audio: signed.audio_timescale === undefined ? null : BigInt(signed.audio_timescale) }) + +/** Whether the proof carries an entry for every index from 0 to `segment_count − 1`, each once. */ +const timingEntriesComplete = (entries: SegmentEntry[], count: number): boolean => { + const indices = new Set(entries.map((e) => e.gop)) + return entries.length === count && indices.size === count && [...indices].every((i) => Number.isInteger(i) && i >= 0 && i < count) +} + +/** `media.timing.root` recomputed from the entries, in index order. */ +const entriesRoot = (entries: SegmentEntry[]): Buffer => + timingRoot([...entries].sort((a, b) => a.gop - b.gop).map((e) => Buffer.from(e.timing as string, 'base64url'))) + +/** + * §5 *Timing* on a clip: why the located segments are not shown at the signed + * instants, or null when they are. Three ways, in the order they are checked: + * the entries' timing hashes are not authenticated (an entry is missing, so + * the root cannot be recomputed); a located segment's record, read back and + * converted to the signed timescales, does not hash to its entry; or the + * track's single media edit trims inside a located segment. + */ +const clipTimingProblem = ( + read: Extract, signed: { video_timescale: number, audio_timescale?: number }, + entries: SegmentEntry[], verified: number[], authenticated: boolean +): string | null => { + if (!authenticated) return 'the proof does not carry every segment entry, so no segment\'s timing is authenticated' + const byIndex = new Map(entries.map((e) => [e.gop, e.timing as string])) + const scales = signedTimescales(signed) + for (const gop of read.gops) { + if (gop.index === null || !verified.includes(gop.index)) continue + const received = receivedTimingHash(gop.timing, read.timescales, scales) + if (received === null) return `segment ${gop.index}: its timing cannot be expressed in the signed timescales` + if (received.toString('base64url') !== byIndex.get(gop.index)) return `segment ${gop.index}: timing read back differs from the signed one` + if (read.edits.video && editTrims(read.edits.video, gop.extent.video)) return `segment ${gop.index}: the video edit list trims inside it` + if (read.edits.audio && gop.extent.audio && editTrims(read.edits.audio, gop.extent.audio)) return `segment ${gop.index}: the audio edit list trims inside it` + } + return null +} + +/** + * §5 *Timing* on the original: the root the file's own segments give, + * compared with the signed one. Every segment is in an original, each named + * once by its vcap SEI; one that cannot be found, or a record that cannot be + * expressed in the signed timescales, is a timing the core does not describe. + */ +const originalTimingDiffers = ( + read: Extract, signed: { video_timescale: number, audio_timescale?: number, root: string }, + captureId: Buffer, count: number +): boolean => { + const scales = signedTimescales(signed) + const hashes = new Map() + for (const gop of read.gops) { + if (gop.index === null || gop.captureId === null || !gop.captureId.equals(captureId)) continue + hashes.set(gop.index, hashes.has(gop.index) ? null : receivedTimingHash(gop.timing, read.timescales, scales)) + } + const ordered: Buffer[] = [] + for (let n = 0; n < count; n++) { + const h = hashes.get(n) + if (!h) return true + ordered.push(h) + } + return timingRoot(ordered).toString('base64url') !== signed.root +} + /** * §5, *Locating segments*: which signed segments this file really contains. * diff --git a/tools/test/timing.test.ts b/tools/test/timing.test.ts new file mode 100644 index 0000000..bf63199 --- /dev/null +++ b/tools/test/timing.test.ts @@ -0,0 +1,50 @@ +import { describe, expect, it } from 'vitest' +import { createHash } from 'node:crypto' +import { readFileSync } from 'node:fs' +import { join } from 'node:path' +import { readContainer } from '../src/container.js' +import { convertTiming, editTrims, timingRecord, timingRoot } from '../src/timing.js' + +// §5 *Timing*, pinned at the byte level: the layout a sealer and a verifier +// port, the exact timescale conversion, and the media-edit rule's slack. +describe('timing(n)', () => { + it('lays out counts, then fixed-width big-endian values', () => { + const record = timingRecord({ videoDts: [0n, 3000n], videoCts: [0n, -1n], videoEnd: 6001n, audioDts: [0n], audioDur: [1024n] }) + expect(record.toString('hex')).toBe([ + '00000002', // v + '0000000000000000', '0000000000000000', // dts_0 − dts_0, cts_0 + '0000000000000bb8', 'ffffffffffffffff', // dts_1 − dts_0, cts_1 (signed) + '0000000000001771', // end_n − dts_0 + '00000001', // a + '0000000000000000', '00000400' // adts_0 − adts_0, adur_0 + ].join('')) + }) + + it('converts exactly or not at all', () => { + const t = { videoDts: [0n, 3000n], videoCts: [0n, 0n], videoEnd: 6000n, audioDts: [], audioDur: [] } + // A finer timescale with every value doubled maps back exactly. + expect(convertTiming({ ...t, videoDts: [0n, 6000n], videoEnd: 12000n }, { video: 180000n, audio: null }, { video: 90000n, audio: null })).toEqual(t) + // 3001 ticks at 180 kHz is 1500.5 at 90 kHz: not representable, so it differs. + expect(convertTiming({ ...t, videoDts: [0n, 3001n] }, { video: 180000n, audio: null }, { video: 90000n, audio: null })).toBeNull() + // Audio frames with no signed audio timescale cannot be converted. + expect(convertTiming({ ...t, audioDts: [0n], audioDur: [1024n] }, { video: 90000n, audio: 48000n }, { video: 90000n, audio: null })).toBeNull() + }) + + it('gives a media edit one movie tick of slack at the end, none at the start', () => { + const edit = { mediaTime: 0n, movieTimescale: 10000n, mediaTimescale: 90000n } + // 218 178 media ticks are 24 242.0 movie ticks: rounded down, no trim. + expect(editTrims({ ...edit, duration: 24242n }, { start: 0n, end: 218178n })).toBe(false) + expect(editTrims({ ...edit, duration: 24241n }, { start: 0n, end: 218178n })).toBe(true) + expect(editTrims({ ...edit, mediaTime: 1n, duration: 24242n }, { start: 0n, end: 218178n })).toBe(true) + }) + + it('reads back the records vector 175 publishes', () => { + const dir = join(import.meta.dirname, '..', '..', 'vectors', '175-mp4-timing-original') + const debug = (JSON.parse(readFileSync(join(dir, 'expected.json'), 'utf8')) as { debug: { timing_records_hex: string[], root_hex: string } }).debug + const reading = readContainer(readFileSync(join(dir, 'input.mp4'))) + if (reading.kind !== 'gops') throw new Error('vector 175 is not a readable video') + const records = [0, 1, 2].map((n) => timingRecord((reading.gops.find((g) => g.index === n) as { timing: Parameters[0] }).timing)) + expect(records.map((r) => r.toString('hex'))).toEqual(debug.timing_records_hex) + expect(timingRoot(records.map((r) => createHash('sha256').update(r).digest())).toString('hex')).toBe(debug.root_hex) + }) +}) diff --git a/vectors/143-mp4-c2pa-free-excluded/NOTES.md b/vectors/143-mp4-c2pa-free-excluded/NOTES.md index 4c9ea9d..d41f454 100644 --- a/vectors/143-mp4-c2pa-free-excluded/NOTES.md +++ b/vectors/143-mp4-c2pa-free-excluded/NOTES.md @@ -7,6 +7,6 @@ vcap: **authentic**, the manifest is content inside `media.hash` (§4.1), and th ## C2PA - `expected.json` `c2pa`: what c2pa-rs 0.91.0 (c2pa-node 0.9.8), trust anchor _trust/c2pa-test/root.pem reports. Informative: no vcap verdict reads it. -- c2patool 0.28.0 (trust anchor `_trust/c2pa-test/root.pem`): **Trusted**; success: `assertion.bmffHash.match`, `assertion.hashedURI.match`, `claimSignature.insideValidity`, `claimSignature.validated`, `signingCredential.trusted`; informational: `assertion.bmffHash.additionalExclusionsPresent`, `signingCredential.ocsp.skipped`; failure: none. +- c2patool 0.27.16 (trust anchor `_trust/c2pa-test/root.pem`): **Trusted**; success: `assertion.bmffHash.match`, `assertion.hashedURI.match`, `claimSignature.insideValidity`, `claimSignature.validated`, `signingCredential.trusted`; informational: none; failure: none. Minted by `tools/src/make-c2pa-vectors.ts` with the test key in `tools/src/testkey.ts` and the C2PA test signer in `vectors/_trust/c2pa-test/`. Committed, not regenerated: c2pa-rs salts every assertion at random (`vectors/README.md`). diff --git a/vectors/143-mp4-c2pa-free-excluded/expected.json b/vectors/143-mp4-c2pa-free-excluded/expected.json index 4416557..a1d6b18 100644 --- a/vectors/143-mp4-c2pa-free-excluded/expected.json +++ b/vectors/143-mp4-c2pa-free-excluded/expected.json @@ -12,7 +12,7 @@ "watermark not evaluated" ], "not_evaluated": [], - "core_hash": "6d97164d370fb95baae45ad338b4ab1f8086ae8b6cf802dfdf361acb9233362a", + "core_hash": "d4847700cf383a2aa6774cf8688947531ea0de3ed961d990030ef8097f4aa55b", "segments": { "verified": [] }, diff --git a/vectors/143-mp4-c2pa-free-excluded/input.mp4 b/vectors/143-mp4-c2pa-free-excluded/input.mp4 index 7c0b829..9c84073 100644 Binary files a/vectors/143-mp4-c2pa-free-excluded/input.mp4 and b/vectors/143-mp4-c2pa-free-excluded/input.mp4 differ diff --git a/vectors/143-mp4-c2pa-free-excluded/proof.json b/vectors/143-mp4-c2pa-free-excluded/proof.json index aff45ec..9b41f0b 100644 --- a/vectors/143-mp4-c2pa-free-excluded/proof.json +++ b/vectors/143-mp4-c2pa-free-excluded/proof.json @@ -6,7 +6,7 @@ "w": 16, "h": 16, "duration_ms": 67, - "hash": "HHUER1IV1GHU5WxpCa7X44kxg__RCS9yyxAE4r1c6iw", + "hash": "U5rN1owBcJORt7heTTOVULf3J_wXpuxAwgUqVbNps80", "segment_count": 3, "presentation": { "config": "17I-W-TgchCDabrlcW5KJK1-3O6xgFYfkWBNenLVn1Y", @@ -25,6 +25,10 @@ 1048576, 1048576 ] + }, + "timing": { + "video_timescale": 15360, + "root": "8SAPN2RGHS4YHJ-twVgYB8u60ybfYxgfKbtoPbZKYD8" } }, "device": { @@ -57,24 +61,27 @@ "gop": 0, "hash": "kr6s8q6y81Fz3F_6xL4M-VVslfHElaTY-iVP8ZNSMk8", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "gT1cQ8_T7x-wqXTUlrwaeBaaDI2hwLEbUq8LiLmjjN0ageN0YFn4n3h5MM9StoXLhr29GYUCH0-9OHO335VNaQ" + "sig": "gT1cQ8_T7x-wqXTUlrwaeBaaDI2hwLEbUq8LiLmjjN0ageN0YFn4n3h5MM9StoXLhr29GYUCH0-9OHO335VNaQ", + "timing": "nbJ9cqptnj645RNcf22FZr17a2kZ_MgaNOwUKHvm_pw" }, { "gop": 1, "hash": "3q0FJMsh2sAgYapRbubMFw_LjQsWg5LzPptUVqwz9kI", "prev": "lPuR8oUo-FkoxlMOR3MUQgRLVVZ9mzRm1VXfF2nxMUk", - "sig": "o1NDn-dd6ta2gtxe1A3UZY2mD1flCdixblH6Zqe7O2gSfvITDZ8gRgdvXaOJGl_mUdVyEOLic81NGo2V1q8BmQ" + "sig": "o1NDn-dd6ta2gtxe1A3UZY2mD1flCdixblH6Zqe7O2gSfvITDZ8gRgdvXaOJGl_mUdVyEOLic81NGo2V1q8BmQ", + "timing": "hg2oEf9nXS7AlZF--88P2gB4VqWdMkbmvQv_7QAdXSU" }, { "gop": 2, "hash": "9eBHdAvSkalXlM0lAO-pJeKwaNtM-qxGKaL_cjReqHA", "prev": "3DCOQWFjD3ktTMnczAe0MpvrYjS1fMakVD1Z21mq_f8", - "sig": "ECzio8byd1rCeEVVq8hn_AlLn_sZHO-4zJr4CSRI9rZm34XdQjHWyp0e3BEURASIXY2iXmqgoDwzNDiAhaSJGw" + "sig": "ECzio8byd1rCeEVVq8hn_AlLn_sZHO-4zJr4CSRI9rZm34XdQjHWyp0e3BEURASIXY2iXmqgoDwzNDiAhaSJGw", + "timing": "4N7Gn0gEs6bj0p9A9Qiui7S_s9vd275Wx8NKQxUdW_g" } ], "sig": { "alg": "ES256", - "value": "yc-h3vKdEom-Cnw2qkqlCa3u1VYJAeSM25Rja-uP2r89TAS3-khK_OXa_-1aPc-6BxsNBt2_J1gI-eLbFDQr1w", + "value": "N4GhDjNAXOmT08dqSjjtSsCvh7sO_kA4XSZ4fTdHMeQEGfcVe_Uojpikwicb5u8351txK4vuvYl5qyoOglOg9g", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/144-mp4-c2pa-free-hashed/NOTES.md b/vectors/144-mp4-c2pa-free-hashed/NOTES.md index 0fe03e4..47fe67d 100644 --- a/vectors/144-mp4-c2pa-free-hashed/NOTES.md +++ b/vectors/144-mp4-c2pa-free-hashed/NOTES.md @@ -5,6 +5,6 @@ Vector 143 signed with `/free` and `/skip` **not** on the exclusion list (`build ## C2PA - `expected.json` `c2pa`: what c2pa-rs 0.91.0 (c2pa-node 0.9.8), trust anchor _trust/c2pa-test/root.pem reports. Informative: no vcap verdict reads it. -- c2patool 0.28.0 (trust anchor `_trust/c2pa-test/root.pem`): **Invalid**; success: `assertion.hashedURI.match`, `claimSignature.insideValidity`, `claimSignature.validated`, `signingCredential.trusted`; informational: `signingCredential.ocsp.skipped`; failure: `assertion.bmffHash.mismatch`. +- c2patool 0.27.16 (trust anchor `_trust/c2pa-test/root.pem`): **Invalid**; success: `assertion.hashedURI.match`, `claimSignature.insideValidity`, `claimSignature.validated`, `signingCredential.trusted`; informational: none; failure: `assertion.bmffHash.mismatch`. Minted by `tools/src/make-c2pa-vectors.ts` with the test key in `tools/src/testkey.ts` and the C2PA test signer in `vectors/_trust/c2pa-test/`. Committed, not regenerated: c2pa-rs salts every assertion at random (`vectors/README.md`). diff --git a/vectors/144-mp4-c2pa-free-hashed/expected.json b/vectors/144-mp4-c2pa-free-hashed/expected.json index 4dad213..9843fe0 100644 --- a/vectors/144-mp4-c2pa-free-hashed/expected.json +++ b/vectors/144-mp4-c2pa-free-hashed/expected.json @@ -12,7 +12,7 @@ "watermark not evaluated" ], "not_evaluated": [], - "core_hash": "a7f316ea92727cc1b362e4406d2f1cc4c1493964af1ddf0f9b41d1d7fc661eea", + "core_hash": "b5c8b2bdbc510057bacd2ad3e90f70d17c6d70372342bdfb2222c3dccdd44fc8", "segments": { "verified": [] }, diff --git a/vectors/144-mp4-c2pa-free-hashed/input.mp4 b/vectors/144-mp4-c2pa-free-hashed/input.mp4 index ecde7fd..0243ddf 100644 Binary files a/vectors/144-mp4-c2pa-free-hashed/input.mp4 and b/vectors/144-mp4-c2pa-free-hashed/input.mp4 differ diff --git a/vectors/144-mp4-c2pa-free-hashed/proof.json b/vectors/144-mp4-c2pa-free-hashed/proof.json index 2bc8585..6d2c355 100644 --- a/vectors/144-mp4-c2pa-free-hashed/proof.json +++ b/vectors/144-mp4-c2pa-free-hashed/proof.json @@ -6,7 +6,7 @@ "w": 16, "h": 16, "duration_ms": 67, - "hash": "zbxfGvFGoHwEepLxkwMEaMF1oO-mExTfd3XTbISd-Lw", + "hash": "njNdZpJ_3iD6WSLxHitqi5iRxKQNTUDDDrwMtj6E92I", "segment_count": 3, "presentation": { "config": "17I-W-TgchCDabrlcW5KJK1-3O6xgFYfkWBNenLVn1Y", @@ -25,6 +25,10 @@ 1048576, 1048576 ] + }, + "timing": { + "video_timescale": 15360, + "root": "8SAPN2RGHS4YHJ-twVgYB8u60ybfYxgfKbtoPbZKYD8" } }, "device": { @@ -57,24 +61,27 @@ "gop": 0, "hash": "kr6s8q6y81Fz3F_6xL4M-VVslfHElaTY-iVP8ZNSMk8", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "gT1cQ8_T7x-wqXTUlrwaeBaaDI2hwLEbUq8LiLmjjN0ageN0YFn4n3h5MM9StoXLhr29GYUCH0-9OHO335VNaQ" + "sig": "gT1cQ8_T7x-wqXTUlrwaeBaaDI2hwLEbUq8LiLmjjN0ageN0YFn4n3h5MM9StoXLhr29GYUCH0-9OHO335VNaQ", + "timing": "nbJ9cqptnj645RNcf22FZr17a2kZ_MgaNOwUKHvm_pw" }, { "gop": 1, "hash": "3q0FJMsh2sAgYapRbubMFw_LjQsWg5LzPptUVqwz9kI", "prev": "lPuR8oUo-FkoxlMOR3MUQgRLVVZ9mzRm1VXfF2nxMUk", - "sig": "o1NDn-dd6ta2gtxe1A3UZY2mD1flCdixblH6Zqe7O2gSfvITDZ8gRgdvXaOJGl_mUdVyEOLic81NGo2V1q8BmQ" + "sig": "o1NDn-dd6ta2gtxe1A3UZY2mD1flCdixblH6Zqe7O2gSfvITDZ8gRgdvXaOJGl_mUdVyEOLic81NGo2V1q8BmQ", + "timing": "hg2oEf9nXS7AlZF--88P2gB4VqWdMkbmvQv_7QAdXSU" }, { "gop": 2, "hash": "9eBHdAvSkalXlM0lAO-pJeKwaNtM-qxGKaL_cjReqHA", "prev": "3DCOQWFjD3ktTMnczAe0MpvrYjS1fMakVD1Z21mq_f8", - "sig": "ECzio8byd1rCeEVVq8hn_AlLn_sZHO-4zJr4CSRI9rZm34XdQjHWyp0e3BEURASIXY2iXmqgoDwzNDiAhaSJGw" + "sig": "ECzio8byd1rCeEVVq8hn_AlLn_sZHO-4zJr4CSRI9rZm34XdQjHWyp0e3BEURASIXY2iXmqgoDwzNDiAhaSJGw", + "timing": "4N7Gn0gEs6bj0p9A9Qiui7S_s9vd275Wx8NKQxUdW_g" } ], "sig": { "alg": "ES256", - "value": "OoeB9hlrZRPm1yCOwL3ncbDK96TtUEv2Qkw2A1sHgK5nhVMBdDqDXRtqPNLkM60Auh_2aorrIwHiYfhlr0wZ0g", + "value": "Nc-KtQ2-k-a35bpyxCxRuXBrkebX12O1KqW-Bl0rKFFNN_Drv4NSUVfnMatUal-pQoh9wZahptUwdtOb1lLdYA", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/145-mp4-c2pa-clip-parent-of/NOTES.md b/vectors/145-mp4-c2pa-clip-parent-of/NOTES.md index 2061b6d..bbc9a6e 100644 --- a/vectors/145-mp4-c2pa-clip-parent-of/NOTES.md +++ b/vectors/145-mp4-c2pa-clip-parent-of/NOTES.md @@ -2,7 +2,7 @@ A clip made by a C2PA-aware cutter: vector 89's cut of vector 166 — GOP 0 removed, no re-encoding, the vcap SEIs intact — with no trailer, signed with a manifest that opens the source as `parentOf` and records `c2pa.trimmed`. The source's manifest (generation 0, urn:c2pa:76636170-0000-4000-8000-000001450000) carries vector 166's proof and travels in the clip's store as its ingredient. -No footer, no proof at depth 0, no sidecar: the proof is found at depth 1 (§3.2), the nearest ancestor that carries one. The frames name the capture (`frames_name_capture`, a locating hint), GOPs 1 and 2 are located and recompute under §5, the core binds the presentation the clip still has (§5 *Presentation*), and the outcome is **verified clip**, 1 and 2 of 3 — vector 89's verdict, reached without a trailer. The source is vector 166: the container of vector 36's Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device's, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0); the clip bytes are vector 89's cut of it, under the same core. Rebuilt in corpus 6.0.0: the 5.0.0 files carried vector 36's device proof, which predates the field and read *no proof found*. +No footer, no proof at depth 0, no sidecar: the proof is found at depth 1 (§3.2), the nearest ancestor that carries one. The frames name the capture (`frames_name_capture`, a locating hint), GOPs 1 and 2 are located and recompute under §5, the core binds the presentation and the timing the clip still has (§5 *Presentation*, *Timing*), and the outcome is **verified clip**, 1 and 2 of 3 — vector 89's verdict, reached without a trailer. The source is vector 166: the container of vector 36's Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device's, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0) and `media.timing`, with each segment entry's timing hash (corpus 7.0.0); the clip bytes are vector 89's cut of it, under the same core. Rebuilt in corpus 6.0.0, when the 5.0.0 files carried vector 36's device proof, which predates `media.presentation`, and again in 7.0.0 over the core that binds timing. ## C2PA diff --git a/vectors/145-mp4-c2pa-clip-parent-of/expected.json b/vectors/145-mp4-c2pa-clip-parent-of/expected.json index afbbc3f..9fc063e 100644 --- a/vectors/145-mp4-c2pa-clip-parent-of/expected.json +++ b/vectors/145-mp4-c2pa-clip-parent-of/expected.json @@ -10,7 +10,7 @@ "origin not hardware-attested" ], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 1, diff --git a/vectors/145-mp4-c2pa-clip-parent-of/input.mp4 b/vectors/145-mp4-c2pa-clip-parent-of/input.mp4 index ec12780..fb543f8 100644 Binary files a/vectors/145-mp4-c2pa-clip-parent-of/input.mp4 and b/vectors/145-mp4-c2pa-clip-parent-of/input.mp4 differ diff --git a/vectors/145-mp4-c2pa-clip-parent-of/proof.json b/vectors/145-mp4-c2pa-clip-parent-of/proof.json index cbe0841..1f8d2d3 100644 --- a/vectors/145-mp4-c2pa-clip-parent-of/proof.json +++ b/vectors/145-mp4-c2pa-clip-parent-of/proof.json @@ -11,7 +11,7 @@ "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", "mime": "video/mp4", "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "display": [ 41943040, 23592960 @@ -29,6 +29,11 @@ ] }, "segment_count": 3, + "timing": { + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg", + "video_timescale": 90000 + }, "w": 640 }, "segments": [ @@ -36,25 +41,28 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g" + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw" }, "time": { "device_clock": 1788955035726 diff --git a/vectors/146-mp4-c2pa-clip-gop-replaced/NOTES.md b/vectors/146-mp4-c2pa-clip-gop-replaced/NOTES.md index a76a26f..cc12693 100644 --- a/vectors/146-mp4-c2pa-clip-gop-replaced/NOTES.md +++ b/vectors/146-mp4-c2pa-clip-gop-replaced/NOTES.md @@ -2,7 +2,7 @@ Vector 145's clip with one byte of the last GOP's IDR slice data changed (clip byte 148196), signed by a cutter that opens vector 166 as `parentOf` and carries its proof in **its own** manifest, as the clip's: a GOP whose vcap SEI still names the capture and segment 2, and whose bytes are not the ones segment 2 signs. The cutter's manifest is valid — it vouches for the bytes it saw — and declares a trim, not this. -Depth 0 reads like a sidecar (§3.2): §5 applies, a located segment that does not recompute is **tampered**, with segment 1 verified. The corpus's only video case of a tampered proof inside an active C2PA manifest; vector 128 is the JPEG one. Vector 147 is the other side of the rule: at depth ≥ 1 a failure reads *no proof found*, because a proof found up the chain is the source's and is never held against a derivation. The source is vector 166: the container of vector 36's Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device's, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0); the clip bytes are vector 89's cut of it, under the same core. Rebuilt in corpus 6.0.0: the 5.0.0 files carried vector 36's device proof, which predates the field and read *no proof found*. +Depth 0 reads like a sidecar (§3.2): §5 applies, a located segment that does not recompute is **tampered**, with segment 1 verified. The corpus's only video case of a tampered proof inside an active C2PA manifest; vector 128 is the JPEG one. Vector 147 is the other side of the rule: at depth ≥ 1 a failure reads *no proof found*, because a proof found up the chain is the source's and is never held against a derivation. The source is vector 166: the container of vector 36's Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device's, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0) and `media.timing`, with each segment entry's timing hash (corpus 7.0.0); the clip bytes are vector 89's cut of it, under the same core. Rebuilt in corpus 6.0.0, when the 5.0.0 files carried vector 36's device proof, which predates `media.presentation`, and again in 7.0.0 over the core that binds timing. ## C2PA diff --git a/vectors/146-mp4-c2pa-clip-gop-replaced/expected.json b/vectors/146-mp4-c2pa-clip-gop-replaced/expected.json index 1041fd3..63a65f5 100644 --- a/vectors/146-mp4-c2pa-clip-gop-replaced/expected.json +++ b/vectors/146-mp4-c2pa-clip-gop-replaced/expected.json @@ -3,7 +3,7 @@ "outcome": "tampered", "labels": [], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 1 diff --git a/vectors/146-mp4-c2pa-clip-gop-replaced/input.mp4 b/vectors/146-mp4-c2pa-clip-gop-replaced/input.mp4 index 154958d..8e4f038 100644 Binary files a/vectors/146-mp4-c2pa-clip-gop-replaced/input.mp4 and b/vectors/146-mp4-c2pa-clip-gop-replaced/input.mp4 differ diff --git a/vectors/146-mp4-c2pa-clip-gop-replaced/proof.json b/vectors/146-mp4-c2pa-clip-gop-replaced/proof.json index cbe0841..1f8d2d3 100644 --- a/vectors/146-mp4-c2pa-clip-gop-replaced/proof.json +++ b/vectors/146-mp4-c2pa-clip-gop-replaced/proof.json @@ -11,7 +11,7 @@ "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", "mime": "video/mp4", "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "display": [ 41943040, 23592960 @@ -29,6 +29,11 @@ ] }, "segment_count": 3, + "timing": { + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg", + "video_timescale": 90000 + }, "w": 640 }, "segments": [ @@ -36,25 +41,28 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g" + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw" }, "time": { "device_clock": 1788955035726 diff --git a/vectors/147-mp4-c2pa-clip-reencoded/NOTES.md b/vectors/147-mp4-c2pa-clip-reencoded/NOTES.md index daa5d9b..fc22e50 100644 --- a/vectors/147-mp4-c2pa-clip-reencoded/NOTES.md +++ b/vectors/147-mp4-c2pa-clip-reencoded/NOTES.md @@ -1,6 +1,6 @@ # 147-mp4-c2pa-clip-reencoded -What a re-encoding editor leaves: new frames with no vcap SEI (the two-frame MP4 of `_media/` stands in for them), signed with a manifest that opens vector 166's capture as `parentOf` and records `c2pa.transcoded`. The proof is found at depth 1 and is well formed; no GOP names the capture (`frames_name_capture` false) and `media.hash` does not match. §5 alone would say *frames not compared*; at depth ≥ 1 that becomes **no proof found**, reason *Content Credentials carry the proof of a source capture* (§3.2) — never *tampered*. A detector may still add *origin traced* from the watermark. The source is vector 166: the container of vector 36's Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device's, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0); the clip bytes are vector 89's cut of it, under the same core. Rebuilt in corpus 6.0.0: the 5.0.0 files carried vector 36's device proof, which predates the field and read *no proof found*. +What a re-encoding editor leaves: new frames with no vcap SEI (the two-frame MP4 of `_media/` stands in for them), signed with a manifest that opens vector 166's capture as `parentOf` and records `c2pa.transcoded`. The proof is found at depth 1 and is well formed; no GOP names the capture (`frames_name_capture` false) and `media.hash` does not match. §5 alone would say *frames not compared*; at depth ≥ 1 that becomes **no proof found**, reason *Content Credentials carry the proof of a source capture* (§3.2) — never *tampered*. A detector may still add *origin traced* from the watermark. The source is vector 166: the container of vector 36's Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device's, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0) and `media.timing`, with each segment entry's timing hash (corpus 7.0.0); the clip bytes are vector 89's cut of it, under the same core. Rebuilt in corpus 6.0.0, when the 5.0.0 files carried vector 36's device proof, which predates `media.presentation`, and again in 7.0.0 over the core that binds timing. ## C2PA diff --git a/vectors/147-mp4-c2pa-clip-reencoded/expected.json b/vectors/147-mp4-c2pa-clip-reencoded/expected.json index 968a09c..c6fd6e1 100644 --- a/vectors/147-mp4-c2pa-clip-reencoded/expected.json +++ b/vectors/147-mp4-c2pa-clip-reencoded/expected.json @@ -3,7 +3,7 @@ "outcome": "no_proof_found", "labels": [], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "proof_source": { "kind": "c2pa", "manifest": "urn:c2pa:76636170-0000-4000-8000-000001450000", diff --git a/vectors/147-mp4-c2pa-clip-reencoded/input.mp4 b/vectors/147-mp4-c2pa-clip-reencoded/input.mp4 index f8d0aef..acdba1d 100644 Binary files a/vectors/147-mp4-c2pa-clip-reencoded/input.mp4 and b/vectors/147-mp4-c2pa-clip-reencoded/input.mp4 differ diff --git a/vectors/147-mp4-c2pa-clip-reencoded/proof.json b/vectors/147-mp4-c2pa-clip-reencoded/proof.json index cbe0841..1f8d2d3 100644 --- a/vectors/147-mp4-c2pa-clip-reencoded/proof.json +++ b/vectors/147-mp4-c2pa-clip-reencoded/proof.json @@ -11,7 +11,7 @@ "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", "mime": "video/mp4", "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "display": [ 41943040, 23592960 @@ -29,6 +29,11 @@ ] }, "segment_count": 3, + "timing": { + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg", + "video_timescale": 90000 + }, "w": 640 }, "segments": [ @@ -36,25 +41,28 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g" + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw" }, "time": { "device_clock": 1788955035726 diff --git a/vectors/156-mp4-container-edit-list-reorders/NOTES.md b/vectors/156-mp4-container-edit-list-reorders/NOTES.md index f657f67..4efceee 100644 --- a/vectors/156-mp4-container-edit-list-reorders/NOTES.md +++ b/vectors/156-mp4-container-edit-list-reorders/NOTES.md @@ -4,4 +4,4 @@ Vector 37 with an edit list added to its video track, and nothing else: the samp §5 places segments on the presentation timeline, and an edit list with more than one edit after the leading delay — or one that changes rate — describes a timeline a verifier does not model: it MUST NOT recompute segments over it as if the extra edits were not there. Nothing is located, so nothing is credited, and `media.hash` does not match: **frames not compared**, with *segment content not recomputed*. A verifier that read only the first edit, as both implementations did before corpus 4.0.0, verified all three segments and reported **verified clip** over frames shown in an order nobody signed. An original is unaffected — `media.hash` covers its edit list with everything else. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/156-mp4-container-edit-list-reorders/expected.json b/vectors/156-mp4-container-edit-list-reorders/expected.json index 95bc386..b2a3d21 100644 --- a/vectors/156-mp4-container-edit-list-reorders/expected.json +++ b/vectors/156-mp4-container-edit-list-reorders/expected.json @@ -11,7 +11,7 @@ "segment content not recomputed" ], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [] }, diff --git a/vectors/156-mp4-container-edit-list-reorders/input.mp4 b/vectors/156-mp4-container-edit-list-reorders/input.mp4 index 5b12b91..20f39b8 100644 Binary files a/vectors/156-mp4-container-edit-list-reorders/input.mp4 and b/vectors/156-mp4-container-edit-list-reorders/input.mp4 differ diff --git a/vectors/156-mp4-container-edit-list-reorders/proof.json b/vectors/156-mp4-container-edit-list-reorders/proof.json index bb8f248..5465fe4 100644 --- a/vectors/156-mp4-container-edit-list-reorders/proof.json +++ b/vectors/156-mp4-container-edit-list-reorders/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/158-mp4-presentation-original/NOTES.md b/vectors/158-mp4-presentation-original/NOTES.md index ed85932..9b1af0f 100644 --- a/vectors/158-mp4-presentation-original/NOTES.md +++ b/vectors/158-mp4-presentation-original/NOTES.md @@ -1,5 +1,5 @@ # 158-mp4-presentation-original -Vector 37's file with a core that carries `media.presentation` (§6.1): the SHA-256 of the presentation message over the `hvcC` parameter sets — VPS, SPS, PPS, in NAL type order — and the sample entry's `clap`, `pasp` and `colr` boxes (this file has none), the video `tkhd` matrix (identity) and its display size, 640×360 in 16.16. **Authentic**: an original is covered whole by `media.hash`, and the presentation read back from it is the signed one. +Vector 37's file with a core that carries `media.presentation` (§6.1): the SHA-256 of the presentation message over the `hvcC` parameter sets — VPS, SPS, PPS, in NAL type order — and the sample entry's `clap`, `pasp` and `colr` boxes (this file has a `colr`, `nclx`, the one `MediaMuxer` wrote), the video `tkhd` matrix (identity) and its display size, 640×360 in 16.16. **Authentic**: an original is covered whole by `media.hash`, and the presentation and the timing read back from it are the signed ones. -The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation`. +The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation` and `media.timing` (no audio track, so no `audio_timescale`). diff --git a/vectors/158-mp4-presentation-original/expected.json b/vectors/158-mp4-presentation-original/expected.json index 5b89064..fb4ef1f 100644 --- a/vectors/158-mp4-presentation-original/expected.json +++ b/vectors/158-mp4-presentation-original/expected.json @@ -10,7 +10,7 @@ "origin not hardware-attested" ], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [ 0, diff --git a/vectors/158-mp4-presentation-original/input.mp4 b/vectors/158-mp4-presentation-original/input.mp4 index b155462..5202e72 100644 Binary files a/vectors/158-mp4-presentation-original/input.mp4 and b/vectors/158-mp4-presentation-original/input.mp4 differ diff --git a/vectors/158-mp4-presentation-original/proof.json b/vectors/158-mp4-presentation-original/proof.json index bb8f248..5465fe4 100644 --- a/vectors/158-mp4-presentation-original/proof.json +++ b/vectors/158-mp4-presentation-original/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/159-mp4-presentation-clip/NOTES.md b/vectors/159-mp4-presentation-clip/NOTES.md index 7f4fe86..aecedcb 100644 --- a/vectors/159-mp4-presentation-clip/NOTES.md +++ b/vectors/159-mp4-presentation-clip/NOTES.md @@ -1,5 +1,5 @@ # 159-mp4-presentation-clip -Vector 158 cut: GOP 0 dropped from the sample tables by `remux.ts`, which copies the track header and the sample description as they were. Both remaining GOPs are located and recompute, and the clip presents them exactly as the core says — the same parameter sets, the same matrix, the same display size, one video track. **Verified clip**, 1 and 2 of 3: the case §5 *Presentation* must leave alone. +Vector 158 cut: GOP 0 dropped from the sample tables by `remux.ts`, which copies the track header and the sample description as they were. Both remaining GOPs are located and recompute, and the clip presents them exactly as the core says — the same parameter sets, the same matrix, the same display size, one video track, the same timing records (a silent file: `media.timing` has no `audio_timescale`, and every record has `a = 0`). **Verified clip**, 1 and 2 of 3: the case §5 *Presentation* must leave alone. -The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation`. +The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation` and `media.timing` (no audio track, so no `audio_timescale`). diff --git a/vectors/159-mp4-presentation-clip/expected.json b/vectors/159-mp4-presentation-clip/expected.json index 08c47c1..a816768 100644 --- a/vectors/159-mp4-presentation-clip/expected.json +++ b/vectors/159-mp4-presentation-clip/expected.json @@ -10,7 +10,7 @@ "origin not hardware-attested" ], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [ 1, diff --git a/vectors/159-mp4-presentation-clip/input.mp4 b/vectors/159-mp4-presentation-clip/input.mp4 index a2bdf11..1ddeb2b 100644 Binary files a/vectors/159-mp4-presentation-clip/input.mp4 and b/vectors/159-mp4-presentation-clip/input.mp4 differ diff --git a/vectors/159-mp4-presentation-clip/proof.json b/vectors/159-mp4-presentation-clip/proof.json index bb8f248..5465fe4 100644 --- a/vectors/159-mp4-presentation-clip/proof.json +++ b/vectors/159-mp4-presentation-clip/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/160-mp4-presentation-clip-rotated/NOTES.md b/vectors/160-mp4-presentation-clip-rotated/NOTES.md index ece1b3e..b490bdd 100644 --- a/vectors/160-mp4-presentation-clip-rotated/NOTES.md +++ b/vectors/160-mp4-presentation-clip-rotated/NOTES.md @@ -2,4 +2,4 @@ Vector 159 with its video track header's matrix turned 90°: every sample untouched, every GOP still located and recomputing, and a player shows the frames on their side. A rotation, a mirror or a translation changes what a reader sees without touching a signed byte, and before `media.presentation` a clip carried no claim it could be held to. The matrix read back differs from the signed one: **frames not compared**, *presentation differs*, and no segment is credited — the signed frames are here, the way they are shown is not what was signed. Not *tampered*: re-muxing a clip is not an accusation, as a `media.hash` that does not match is not one (§5 *Presentation*). -The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation`. +The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation` and `media.timing` (no audio track, so no `audio_timescale`). diff --git a/vectors/160-mp4-presentation-clip-rotated/expected.json b/vectors/160-mp4-presentation-clip-rotated/expected.json index c30367d..ffc4990 100644 --- a/vectors/160-mp4-presentation-clip-rotated/expected.json +++ b/vectors/160-mp4-presentation-clip-rotated/expected.json @@ -11,7 +11,7 @@ "presentation differs" ], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [] }, diff --git a/vectors/160-mp4-presentation-clip-rotated/input.mp4 b/vectors/160-mp4-presentation-clip-rotated/input.mp4 index f095bc3..93e1857 100644 Binary files a/vectors/160-mp4-presentation-clip-rotated/input.mp4 and b/vectors/160-mp4-presentation-clip-rotated/input.mp4 differ diff --git a/vectors/160-mp4-presentation-clip-rotated/proof.json b/vectors/160-mp4-presentation-clip-rotated/proof.json index bb8f248..5465fe4 100644 --- a/vectors/160-mp4-presentation-clip-rotated/proof.json +++ b/vectors/160-mp4-presentation-clip-rotated/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/161-mp4-presentation-clip-sps-edited/NOTES.md b/vectors/161-mp4-presentation-clip-sps-edited/NOTES.md index bcaabe3..5ad3595 100644 --- a/vectors/161-mp4-presentation-clip-sps-edited/NOTES.md +++ b/vectors/161-mp4-presentation-clip-sps-edited/NOTES.md @@ -2,4 +2,4 @@ Vector 159 with one bit of the SPS in its `hvcC` flipped (file byte 102213, the last byte of the SPS). Parameter sets carried only in the decoder configuration are in no sample, so no `content_hash` covers them — and they decide the conformance window (the crop), the VUI colour description and how every slice is decoded. The frames' bytes are the signed ones; the decoder that reads them is told something else. The configuration hash read back differs from the signed one: **frames not compared**, *presentation differs*, nothing credited. -The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation`. +The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation` and `media.timing` (no audio track, so no `audio_timescale`). diff --git a/vectors/161-mp4-presentation-clip-sps-edited/expected.json b/vectors/161-mp4-presentation-clip-sps-edited/expected.json index c30367d..ffc4990 100644 --- a/vectors/161-mp4-presentation-clip-sps-edited/expected.json +++ b/vectors/161-mp4-presentation-clip-sps-edited/expected.json @@ -11,7 +11,7 @@ "presentation differs" ], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [] }, diff --git a/vectors/161-mp4-presentation-clip-sps-edited/input.mp4 b/vectors/161-mp4-presentation-clip-sps-edited/input.mp4 index 7908f03..0619504 100644 Binary files a/vectors/161-mp4-presentation-clip-sps-edited/input.mp4 and b/vectors/161-mp4-presentation-clip-sps-edited/input.mp4 differ diff --git a/vectors/161-mp4-presentation-clip-sps-edited/proof.json b/vectors/161-mp4-presentation-clip-sps-edited/proof.json index bb8f248..5465fe4 100644 --- a/vectors/161-mp4-presentation-clip-sps-edited/proof.json +++ b/vectors/161-mp4-presentation-clip-sps-edited/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/162-mp4-presentation-clip-extra-track/NOTES.md b/vectors/162-mp4-presentation-clip-extra-track/NOTES.md index 377e73a..9f71698 100644 --- a/vectors/162-mp4-presentation-clip-extra-track/NOTES.md +++ b/vectors/162-mp4-presentation-clip-extra-track/NOTES.md @@ -2,4 +2,4 @@ Vector 159 with a second enabled video track: a copy of the first, appended to `moov`. A segment hash covers the first video track and the first audio track; a player may show any enabled track, and an attacker's track would be one no signature covers — overlaid text, another picture, another soundtrack. §5 *Presentation*: a clip is bound only when its file has exactly one `vide` track, at most one `soun` track, one sample description each, and every other track disabled. **Frames not compared**, *tracks not bound*, nothing credited. -The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation`. +The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation` and `media.timing` (no audio track, so no `audio_timescale`). diff --git a/vectors/162-mp4-presentation-clip-extra-track/expected.json b/vectors/162-mp4-presentation-clip-extra-track/expected.json index 86c121f..db06526 100644 --- a/vectors/162-mp4-presentation-clip-extra-track/expected.json +++ b/vectors/162-mp4-presentation-clip-extra-track/expected.json @@ -11,7 +11,7 @@ "tracks not bound" ], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [] }, diff --git a/vectors/162-mp4-presentation-clip-extra-track/input.mp4 b/vectors/162-mp4-presentation-clip-extra-track/input.mp4 index 59cc161..c7fc8b8 100644 Binary files a/vectors/162-mp4-presentation-clip-extra-track/input.mp4 and b/vectors/162-mp4-presentation-clip-extra-track/input.mp4 differ diff --git a/vectors/162-mp4-presentation-clip-extra-track/proof.json b/vectors/162-mp4-presentation-clip-extra-track/proof.json index bb8f248..5465fe4 100644 --- a/vectors/162-mp4-presentation-clip-extra-track/proof.json +++ b/vectors/162-mp4-presentation-clip-extra-track/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/163-mp4-presentation-original-misdescribed/NOTES.md b/vectors/163-mp4-presentation-original-misdescribed/NOTES.md index b110db4..b1e717d 100644 --- a/vectors/163-mp4-presentation-original-misdescribed/NOTES.md +++ b/vectors/163-mp4-presentation-original-misdescribed/NOTES.md @@ -2,4 +2,4 @@ Vector 158 with a core whose signed `media.presentation.matrix` says 90° while the file it seals is not rotated: a writer that computed the field from something other than the file it produced. The bytes are exactly the sealed ones — `media.hash` matches — so the outcome stays **authentic**, and the false claim is the device's: *presentation differs*, amber at best, the way a level claimed above its evidence is *inconsistent claim* and never *tampered* (§7). A writer conformance suite catches this on its first file. -The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation`. +The container is the device capture of vector 37 (a Samsung SM-S908B, HEVC, no audio); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core can carry `media.presentation` and `media.timing` (no audio track, so no `audio_timescale`). diff --git a/vectors/163-mp4-presentation-original-misdescribed/expected.json b/vectors/163-mp4-presentation-original-misdescribed/expected.json index ae298a8..138d34b 100644 --- a/vectors/163-mp4-presentation-original-misdescribed/expected.json +++ b/vectors/163-mp4-presentation-original-misdescribed/expected.json @@ -11,7 +11,7 @@ "presentation differs" ], "not_evaluated": [], - "core_hash": "13bdc7c61865501e020df0ccda5bfcc1c79d07dc0c50ebaed1157bfb5ffffd7e", + "core_hash": "05aa2618246dc19910548cba5b4fd2656447435335605331c63688a6ff106213", "segments": { "verified": [ 0, diff --git a/vectors/163-mp4-presentation-original-misdescribed/input.mp4 b/vectors/163-mp4-presentation-original-misdescribed/input.mp4 index 7f0c17e..2fa55d3 100644 Binary files a/vectors/163-mp4-presentation-original-misdescribed/input.mp4 and b/vectors/163-mp4-presentation-original-misdescribed/input.mp4 differ diff --git a/vectors/163-mp4-presentation-original-misdescribed/proof.json b/vectors/163-mp4-presentation-original-misdescribed/proof.json index e66a0d8..3a997a4 100644 --- a/vectors/163-mp4-presentation-original-misdescribed/proof.json +++ b/vectors/163-mp4-presentation-original-misdescribed/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "UE7hp9f2T2FDIT1ijio3o77JZqK6wp7RL9Kx0R-4ln4WbmHpFMt-puXR76CBb-ZtpWG6Lo3kaymUZbkyVIGXoA", + "value": "xGZmNYOh2sFsWz-kgmcL6ULddEDQ7eC1DMCGc-y8sXkuV_RtI4N6yDk3LHjAphmkUfmKWIRyzy1XXIkdmYHN2A", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/165-mp4-video-without-presentation/NOTES.md b/vectors/165-mp4-video-without-presentation/NOTES.md index 8475929..8c3cfba 100644 --- a/vectors/165-mp4-video-without-presentation/NOTES.md +++ b/vectors/165-mp4-video-without-presentation/NOTES.md @@ -1,6 +1,6 @@ # 165-mp4-video-without-presentation -Vector 33 with a core signed without `media.presentation`: segments, `segment_count` and a valid signature over a core that never carried the field. §6.1 and §8 require it of every proof that carries `segments`, and so of every video proof — missing required field, **no proof found**, the answer vector 34 gets for a video proof without `segments`, and the shape check gives it before the signature is read. +Vector 33 with a core signed without `media.presentation` (it carries `media.timing`, so that is the one field missing): segments, `segment_count` and a valid signature over a core that never carried the field. §6.1 and §8 require it of every proof that carries `segments`, and so of every video proof — missing required field, **no proof found**, the answer vector 34 gets for a video proof without `segments`, and the shape check gives it before the signature is read. Until corpus 5.0.0 the field was required of writers and optional to readers: an original without it read *authentic* and every clip of it *frames not compared*, *presentation not bound*. That left a video proof two verdicts depending on which file it was attached to, and a core with nothing to hold a clip's parameter sets, matrix or tracks against. The device captures 36, 37, 48 and 85 predate the field and now read the same. diff --git a/vectors/165-mp4-video-without-presentation/input.mp4 b/vectors/165-mp4-video-without-presentation/input.mp4 index 5e6aa60..434f03d 100644 Binary files a/vectors/165-mp4-video-without-presentation/input.mp4 and b/vectors/165-mp4-video-without-presentation/input.mp4 differ diff --git a/vectors/165-mp4-video-without-presentation/proof.json b/vectors/165-mp4-video-without-presentation/proof.json index f661b71..f84d8ad 100644 --- a/vectors/165-mp4-video-without-presentation/proof.json +++ b/vectors/165-mp4-video-without-presentation/proof.json @@ -7,7 +7,11 @@ "h": 16, "duration_ms": 67, "hash": "dHZ_-B2SW0MWk4ff54vKuSnETm7pcRHonTGPWIzGB-g", - "segment_count": 3 + "segment_count": 3, + "timing": { + "video_timescale": 15360, + "root": "8SAPN2RGHS4YHJ-twVgYB8u60ybfYxgfKbtoPbZKYD8" + } }, "device": { "platform": "android", @@ -39,24 +43,27 @@ "gop": 0, "hash": "kr6s8q6y81Fz3F_6xL4M-VVslfHElaTY-iVP8ZNSMk8", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "gT1cQ8_T7x-wqXTUlrwaeBaaDI2hwLEbUq8LiLmjjN0ageN0YFn4n3h5MM9StoXLhr29GYUCH0-9OHO335VNaQ" + "sig": "gT1cQ8_T7x-wqXTUlrwaeBaaDI2hwLEbUq8LiLmjjN0ageN0YFn4n3h5MM9StoXLhr29GYUCH0-9OHO335VNaQ", + "timing": "nbJ9cqptnj645RNcf22FZr17a2kZ_MgaNOwUKHvm_pw" }, { "gop": 1, "hash": "3q0FJMsh2sAgYapRbubMFw_LjQsWg5LzPptUVqwz9kI", "prev": "lPuR8oUo-FkoxlMOR3MUQgRLVVZ9mzRm1VXfF2nxMUk", - "sig": "o1NDn-dd6ta2gtxe1A3UZY2mD1flCdixblH6Zqe7O2gSfvITDZ8gRgdvXaOJGl_mUdVyEOLic81NGo2V1q8BmQ" + "sig": "o1NDn-dd6ta2gtxe1A3UZY2mD1flCdixblH6Zqe7O2gSfvITDZ8gRgdvXaOJGl_mUdVyEOLic81NGo2V1q8BmQ", + "timing": "hg2oEf9nXS7AlZF--88P2gB4VqWdMkbmvQv_7QAdXSU" }, { "gop": 2, "hash": "9eBHdAvSkalXlM0lAO-pJeKwaNtM-qxGKaL_cjReqHA", "prev": "3DCOQWFjD3ktTMnczAe0MpvrYjS1fMakVD1Z21mq_f8", - "sig": "ECzio8byd1rCeEVVq8hn_AlLn_sZHO-4zJr4CSRI9rZm34XdQjHWyp0e3BEURASIXY2iXmqgoDwzNDiAhaSJGw" + "sig": "ECzio8byd1rCeEVVq8hn_AlLn_sZHO-4zJr4CSRI9rZm34XdQjHWyp0e3BEURASIXY2iXmqgoDwzNDiAhaSJGw", + "timing": "4N7Gn0gEs6bj0p9A9Qiui7S_s9vd275Wx8NKQxUdW_g" } ], "sig": { "alg": "ES256", - "value": "ZajD8BnvnIhuBIIIVErahrMhBQ265SYVxuZxzRWXL50UrH4CA6kHaM8Pu1uL9TwS7iGOnavpYakKtQP2VgvPbA", + "value": "A2V9mujLqSp0ETVfZnxW8k2PkQ0-Uctc81YnozA-RVk7JrqREKeTwb6AzF4l-RWROHspMqS_IQkvhcvs2jFGmg", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/166-mp4-container-h264-presentation/NOTES.md b/vectors/166-mp4-container-h264-presentation/NOTES.md index 1dbcd57..d5fbcbe 100644 --- a/vectors/166-mp4-container-h264-presentation/NOTES.md +++ b/vectors/166-mp4-container-h264-presentation/NOTES.md @@ -4,4 +4,4 @@ Vector 36's recording under a core that carries `media.presentation` (§6.1): th What only a real file carries is still here: the video track has an **empty edit** (473 ms) because the microphone started before the camera, so a verifier that ignores the edit list pulls 23 audio frames into segment 0 and gets three wrong hashes; and each GOP carries a vcap SEI, excluded from its own hash. **Authentic**, all three segments located and recomputed. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/166-mp4-container-h264-presentation/expected.json b/vectors/166-mp4-container-h264-presentation/expected.json index 2d2d8db..322ceb8 100644 --- a/vectors/166-mp4-container-h264-presentation/expected.json +++ b/vectors/166-mp4-container-h264-presentation/expected.json @@ -10,7 +10,7 @@ "origin not hardware-attested" ], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 0, diff --git a/vectors/166-mp4-container-h264-presentation/input.mp4 b/vectors/166-mp4-container-h264-presentation/input.mp4 index 9f2b3c8..b52567e 100644 Binary files a/vectors/166-mp4-container-h264-presentation/input.mp4 and b/vectors/166-mp4-container-h264-presentation/input.mp4 differ diff --git a/vectors/166-mp4-container-h264-presentation/proof.json b/vectors/166-mp4-container-h264-presentation/proof.json index 2c15cda..eca07c3 100644 --- a/vectors/166-mp4-container-h264-presentation/proof.json +++ b/vectors/166-mp4-container-h264-presentation/proof.json @@ -9,7 +9,7 @@ "segment_count": 3, "w": 640, "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "matrix": [ 65536, 0, @@ -25,6 +25,11 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" } }, "device": { @@ -40,24 +45,27 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/167-mov-container-ios-presentation/NOTES.md b/vectors/167-mov-container-ios-presentation/NOTES.md index e81f62e..7b92075 100644 --- a/vectors/167-mov-container-ios-presentation/NOTES.md +++ b/vectors/167-mov-container-ios-presentation/NOTES.md @@ -2,4 +2,4 @@ Vector 48's QuickTime file under a core that carries `media.presentation`: the `avcC` parameter sets and no `clap`, `pasp` or `colr` (the iPhone wrote none), the identity matrix and 1280×720 in 16.16. **Authentic**, three segments recomputed from a container `AVAssetWriter` muxed. -The container is the iPhone capture of vector 48 (an iPhone 11 Pro, iOS 18.6.2, `AVAssetWriter`); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the proof of vector 48 predates (corpus 5.0.0). +The container is the iPhone capture of vector 48 (an iPhone 11 Pro, iOS 18.6.2, `AVAssetWriter`); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing`, which the proof of vector 48 predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/167-mov-container-ios-presentation/expected.json b/vectors/167-mov-container-ios-presentation/expected.json index 758801c..3991ccb 100644 --- a/vectors/167-mov-container-ios-presentation/expected.json +++ b/vectors/167-mov-container-ios-presentation/expected.json @@ -26,6 +26,6 @@ "instant": "2026-09-10T10:55:38.426Z", "source": "device_clock" }, - "core_hash": "aaa2c4deaaff36f2dbdd334db255f3dab043b8180cd190b315f5ab63eb6cc0a3", + "core_hash": "f413bbb758ab8378f19307e6a34d20f2f82fbd0e1910b900b3078d7056c2fd4b", "schema_valid": true } diff --git a/vectors/167-mov-container-ios-presentation/input.mov b/vectors/167-mov-container-ios-presentation/input.mov index 17bdf84..1cc8a11 100644 Binary files a/vectors/167-mov-container-ios-presentation/input.mov and b/vectors/167-mov-container-ios-presentation/input.mov differ diff --git a/vectors/167-mov-container-ios-presentation/proof.json b/vectors/167-mov-container-ios-presentation/proof.json index 5d7baae..a29f373 100644 --- a/vectors/167-mov-container-ios-presentation/proof.json +++ b/vectors/167-mov-container-ios-presentation/proof.json @@ -25,6 +25,10 @@ 83886080, 47185920 ] + }, + "timing": { + "video_timescale": 600, + "root": "OWhbGx26rwlKgn9tX5Ftx_vyYcWrPll10Bz1rwpiSxs" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "6WYPv5nGpPmlsrCuqyM_6ckQMVp4PHhPObVl_CJxIXY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "XDF3IHhZvSh66tITcgwPGq0PTqC98NlZhfC8-HohCXI1Zu02C76LXfROvXH055UMHIq8oed81JM_4JFlM_9ijQ" + "sig": "XDF3IHhZvSh66tITcgwPGq0PTqC98NlZhfC8-HohCXI1Zu02C76LXfROvXH055UMHIq8oed81JM_4JFlM_9ijQ", + "timing": "Ol8_lsVythWF3NOyOTZFBA_0eyMRFp5T1_x-b-QjWaE" }, { "gop": 1, "hash": "uV9VpR4bOo89zZFWrl1YtGj4kOesb3EDbmxUMSS6Gw8", "prev": "5qcLtVRtG_NIUxvnISiFaLPcsBEaThByOSOP57DAlCM", - "sig": "InMNEqEEPlol9Agoa_FOLnYJoxemgh7B1hskEdAy2V0KRnCpIAQHOHQmH0H8wnlo14wfxFsv3nuS62aF7jNVOw" + "sig": "InMNEqEEPlol9Agoa_FOLnYJoxemgh7B1hskEdAy2V0KRnCpIAQHOHQmH0H8wnlo14wfxFsv3nuS62aF7jNVOw", + "timing": "Ol8_lsVythWF3NOyOTZFBA_0eyMRFp5T1_x-b-QjWaE" }, { "gop": 2, "hash": "TJrEZzJczuvAbQG1JOa8NVO4f9I3gWwL5FwElAnBOVU", "prev": "7fS_BtM7WFmvTg6hn8-7F1m-H7D3Im1MMf3v0EqJuos", - "sig": "sKiGKwMT-thQfd-0eQM3nw_xXEemWXLTdUQ3GGXH-v1kuF2fIN1H-NwPzyqFu6iTgoOrZ5nV1phu5bdEiikV9Q" + "sig": "sKiGKwMT-thQfd-0eQM3nw_xXEemWXLTdUQ3GGXH-v1kuF2fIN1H-NwPzyqFu6iTgoOrZ5nV1phu5bdEiikV9Q", + "timing": "Ol8_lsVythWF3NOyOTZFBA_0eyMRFp5T1_x-b-QjWaE" } ], "sig": { "alg": "ES256", - "value": "S3TTvnRm_kBqD6O1E0kozL7Vn4ywmDLjmuskj8vhljpXtA-Rv1OU8Xul6gDDE59Iq06fy4VqCUFHbmyWOzlPJQ", + "value": "3d3e2i9q6MjdEeqahjtF237Z-sMkSWNzFPnvrX6UAeogXKG04kjTV5kTswxnwVheIIThMHfUIUdiObW1A3xHxA", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/168-mp4-container-ios-presentation/NOTES.md b/vectors/168-mp4-container-ios-presentation/NOTES.md index 1ead875..402d3fe 100644 --- a/vectors/168-mp4-container-ios-presentation/NOTES.md +++ b/vectors/168-mp4-container-ios-presentation/NOTES.md @@ -2,4 +2,4 @@ Vector 85's recording under a core that carries `media.presentation`: the configuration record alone in the sample entry, the identity matrix and 1280×720 in 16.16, and the eleven segments the device wrote — five of them one frame long, which a reader has to handle like any other (`vectors/README.md`, *Errata*). **Authentic**, every segment recomputed. The Secure Enclave signatures are vector 85's and stay there. -The container is the iPhone capture of vector 85 (an iPhone 11 Pro, iOS 18.6.2, `AVAssetWriter`); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the proof of vector 85 predates (corpus 5.0.0). +The container is the iPhone capture of vector 85 (an iPhone 11 Pro, iOS 18.6.2, `AVAssetWriter`); the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing`, which the proof of vector 85 predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/168-mp4-container-ios-presentation/expected.json b/vectors/168-mp4-container-ios-presentation/expected.json index 73908f5..500e404 100644 --- a/vectors/168-mp4-container-ios-presentation/expected.json +++ b/vectors/168-mp4-container-ios-presentation/expected.json @@ -38,6 +38,6 @@ "claimed": "none", "level": "none" }, - "core_hash": "ca529a7a66fe32b579fa628920d1a3f5aead16507f454a264b5660ce8b4a382d", + "core_hash": "ba4b822c8f05d1ffae71a0c8ae7ceb62fa5caf440545301100c71c0ab2956ad9", "schema_valid": true } diff --git a/vectors/168-mp4-container-ios-presentation/input.mp4 b/vectors/168-mp4-container-ios-presentation/input.mp4 index 40f76d9..27b7bcd 100644 Binary files a/vectors/168-mp4-container-ios-presentation/input.mp4 and b/vectors/168-mp4-container-ios-presentation/input.mp4 differ diff --git a/vectors/168-mp4-container-ios-presentation/proof.json b/vectors/168-mp4-container-ios-presentation/proof.json index e06a5cf..7f31256 100644 --- a/vectors/168-mp4-container-ios-presentation/proof.json +++ b/vectors/168-mp4-container-ios-presentation/proof.json @@ -25,6 +25,10 @@ 83886080, 47185920 ] + }, + "timing": { + "video_timescale": 600, + "root": "eqk-nA_m7Hs33D6MxU13cBz0jOwULAoBKyi79pvgpzA" } }, "device": { @@ -48,72 +52,83 @@ "gop": 0, "hash": "cWZn8GaB8tFgQTlrb5ylnhMJibGryDD8nLDsSX1eoww", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "S5wuBvUNFGTfzDhReU2zQxAkgmgJ9qag3NmmDzY6_0V4NTj8xekDy2Un7lQHzWfVuVkeblhSVSmZs-f4iETmTw" + "sig": "S5wuBvUNFGTfzDhReU2zQxAkgmgJ9qag3NmmDzY6_0V4NTj8xekDy2Un7lQHzWfVuVkeblhSVSmZs-f4iETmTw", + "timing": "iLS9oFgF4vvbSPeKa5aVJi2RC4YtjyBcXM7WYa9QdbE" }, { "gop": 1, "hash": "8atZsnVrrx2HkYjO8HzQVlvFq7rDeV8ogMldkiG6kPo", "prev": "SxhRvbeDrk_N0gRzwECWy6C65ECoFQacknuBvcxGdqs", - "sig": "u7qu3trEcCWjL44nFDrIDozyZUhPolIgKSAemZNJuoZYBmuP2C3zLM9-i7j6Vl2SBaWV_TyvwEY6zNaz0M1CSg" + "sig": "u7qu3trEcCWjL44nFDrIDozyZUhPolIgKSAemZNJuoZYBmuP2C3zLM9-i7j6Vl2SBaWV_TyvwEY6zNaz0M1CSg", + "timing": "1DKRNkd_xIqSO855L7IjVQj4Mw6PhYi1sSBI7Wh6T6I" }, { "gop": 2, "hash": "O4BWiCirznm9ZkIn9EQVI2v0DNj87aDhCsnZ1Ig0dAs", "prev": "LAu240-K2q5JrISaLaaDLCxfCBHoq44scJJ__n0xvKo", - "sig": "JXitnDwVsgBXyE0a28Aer68loriHk6poixcVDXqjRI9BdDq6R3k13CzGLDJP17X_-OSqj_sqfL8j_VTrEad7Zw" + "sig": "JXitnDwVsgBXyE0a28Aer68loriHk6poixcVDXqjRI9BdDq6R3k13CzGLDJP17X_-OSqj_sqfL8j_VTrEad7Zw", + "timing": "Ol8_lsVythWF3NOyOTZFBA_0eyMRFp5T1_x-b-QjWaE" }, { "gop": 3, "hash": "ryK7nGnwLS0UuqFio2sI4yhbTQu8H4ch9slRWQIfQrU", "prev": "quhbjmzFyW45HrZnoKz9_LqYRzcv2_ExhscCSxV694Q", - "sig": "lcTXIPbxW7Pui2BDqzvdx1nlJZJ4KE4dIBS-JB_JhSgeD0Q1ABWVMam-_tDOTeP1yUV3wCKo6ZTQ7jf4FaaRQg" + "sig": "lcTXIPbxW7Pui2BDqzvdx1nlJZJ4KE4dIBS-JB_JhSgeD0Q1ABWVMam-_tDOTeP1yUV3wCKo6ZTQ7jf4FaaRQg", + "timing": "1DKRNkd_xIqSO855L7IjVQj4Mw6PhYi1sSBI7Wh6T6I" }, { "gop": 4, "hash": "ucCCLUH8TLDm6WuZKwnvBTpeE3B8usxZ-fJ_rLUrmYM", "prev": "ssKbT0Hlm_NvmqU_Fywp-nMa-x2hPOpDtZ7D0ynRIrc", - "sig": "4MOKaYbDvs9Li7GpNZGqnnIRK3Z1E0-usITak8zK9yhhUCE2-Wg4el6HaA-4kGY0ZIZXMwvQiKLohpg6JnSOkw" + "sig": "4MOKaYbDvs9Li7GpNZGqnnIRK3Z1E0-usITak8zK9yhhUCE2-Wg4el6HaA-4kGY0ZIZXMwvQiKLohpg6JnSOkw", + "timing": "Ol8_lsVythWF3NOyOTZFBA_0eyMRFp5T1_x-b-QjWaE" }, { "gop": 5, "hash": "-UwLfeXxrBUMV9aUXNvCs7SH1x7UeJPEVmQiqPPsl3U", "prev": "wj6EwyJHo_4Eh-XnxozJ2zC3C65kylsAw5TzEiODt9k", - "sig": "VpyOXl9BtA4bfycuXrRvOhDng7XkwSSL1OEIzjCAnel3fl2kFwWKTVb2yi1TI0s1TxIi3qVazhiJrsRU8m3tig" + "sig": "VpyOXl9BtA4bfycuXrRvOhDng7XkwSSL1OEIzjCAnel3fl2kFwWKTVb2yi1TI0s1TxIi3qVazhiJrsRU8m3tig", + "timing": "1DKRNkd_xIqSO855L7IjVQj4Mw6PhYi1sSBI7Wh6T6I" }, { "gop": 6, "hash": "vyk4kQ0xL3heA3qV5_pW6iFewjMZAKC667GIlbtTYRE", "prev": "nEHVAnIbVnHV4aIeBiSfMUT8KLqA0uRTKLSdsNycfnA", - "sig": "lIV1_qmI24pr_TIGrL4HeSSEfIG-YvoosHk0poDK0rJA4BbTbRO4dLiz3RhdLZ8c5JdSdG1ZqdlXHohKbL0M7w" + "sig": "lIV1_qmI24pr_TIGrL4HeSSEfIG-YvoosHk0poDK0rJA4BbTbRO4dLiz3RhdLZ8c5JdSdG1ZqdlXHohKbL0M7w", + "timing": "e44TIyLtQuhPfqjKJw3gxRTAuOeaexcpJj7qfN6Crv8" }, { "gop": 7, "hash": "fqUtoO3OgZezrXXLMklHdZ5udtbiw_k5pacrlG7NI68", "prev": "EnvmFmWMpop5_SIXw0Hgu8CceNELCg7eJ0Hgv7am6EA", - "sig": "ZrP6i11QJll34rSwnQ7ZTdQozqkgLTTzkc5v3ql7WzhL_BwEcf-MtCdH5Kaqgxu1jHSGBjDqfcO2bhibpIVs5Q" + "sig": "ZrP6i11QJll34rSwnQ7ZTdQozqkgLTTzkc5v3ql7WzhL_BwEcf-MtCdH5Kaqgxu1jHSGBjDqfcO2bhibpIVs5Q", + "timing": "1DKRNkd_xIqSO855L7IjVQj4Mw6PhYi1sSBI7Wh6T6I" }, { "gop": 8, "hash": "JOQde8XJUeb1mCucog6fJ1Isx5ynDLqlt1R8OTi6MjY", "prev": "6PlIeIVBcfMI1ns4fVV4Dz_qYg5UqGSAEyd1oYYwze4", - "sig": "Lz6yMT1Aw6rgltF9Z1EXbdReqdYIk93HEKAr5vxVXdZnCeOV8uRqmHL2CEQjqQRSYZ-F1N9xBDOPsAt_AdIVgg" + "sig": "Lz6yMT1Aw6rgltF9Z1EXbdReqdYIk93HEKAr5vxVXdZnCeOV8uRqmHL2CEQjqQRSYZ-F1N9xBDOPsAt_AdIVgg", + "timing": "CNr0HJ4X2-lFuIxmrgm48JMqE656aIk-OYAbjrbxvjo" }, { "gop": 9, "hash": "CzDiIk0X5yOS2Rx1MOE9mH3AbSkK_ZdnRjnR2g94rX4", "prev": "xplNeNuu-hqf4VoXRCY7IlWj90SmAV0uaVIbcSpGPyA", - "sig": "XHztShhD4oKf_vwjPQjU3fa4FRtMl16bzPgHEtJgOLt0IUym9_kHnVVEL7ckto3VDE_zmj053gFPMD2p4aUy0Q" + "sig": "XHztShhD4oKf_vwjPQjU3fa4FRtMl16bzPgHEtJgOLt0IUym9_kHnVVEL7ckto3VDE_zmj053gFPMD2p4aUy0Q", + "timing": "1DKRNkd_xIqSO855L7IjVQj4Mw6PhYi1sSBI7Wh6T6I" }, { "gop": 10, "hash": "_IW5H_2WNw8GxTifLToxQUsRAGF4OQlzY9-cvDndjvQ", "prev": "sxMCi2ZPMaCM4L6UGN2FffIM6leFGNHU9LAsowSxml4", - "sig": "YWKBhe5VVc8jpH5nkk2jSYglZsEhVSHnCc739MEr94saNAp4r3AlnzkpvEi6l9bv6MONO_aV184A7UbhrXqqmQ" + "sig": "YWKBhe5VVc8jpH5nkk2jSYglZsEhVSHnCc739MEr94saNAp4r3AlnzkpvEi6l9bv6MONO_aV184A7UbhrXqqmQ", + "timing": "PjXGNfMHrY-tad_5xOP_59b4UbHKpX9BzaIquRfWOwA" } ], "sig": { "alg": "ES256", - "value": "dC4C8tnpT62YaYSvh-hTgSzi1Xbjk3bmqOFUzMYzgcgnxdDPn7Jecfz9ieJFUGWCems13DW0BOyS0C-Vb74GbA", + "value": "jya-ogy2yncSLm9Z7uzOd6c0yXkal62Soadt8ScrxCgYUjrqrB2h_hMvqtUgUTLC5nlp9lJSKrm2XvY9usCiLg", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/171-mp4-c2pa-foreign-proof-sidecar/NOTES.md b/vectors/171-mp4-c2pa-foreign-proof-sidecar/NOTES.md index e333f53..52ff5cf 100644 --- a/vectors/171-mp4-c2pa-foreign-proof-sidecar/NOTES.md +++ b/vectors/171-mp4-c2pa-foreign-proof-sidecar/NOTES.md @@ -2,7 +2,7 @@ Vector 89's clip of vector 166 — GOP 0 removed, no trailer — next to a sidecar holding vector 166's proof, with a manifest somebody else added whose active manifest carries **another capture's** video proof: vector 166's core and segment hashes under a new capture id, the core and every segment message re-signed for it. Every signature in that proof holds, and no GOP of the clip names its capture, so on its own it reads *frames not compared* (§5, *Locating segments*) — amber, not an accusation, but a genuine clip reduced to "nothing ties these signatures to these frames" by a manifest anyone can write. -§3.1 step 4 judges both: the sidecar's proof locates GOPs 1 and 2 and recomputes them, **verified clip**, 1 and 2 of 3 — vector 89's verdict — which ranks above *frames not compared*, so it stands, with *manifest copy differs* and `proof_source` the sidecar. The source is vector 166: the container of vector 36's Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device's, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0); the clip bytes are vector 89's cut of it, under the same core. Rebuilt in corpus 6.0.0: the 5.0.0 files carried vector 36's device proof, which predates the field and read *no proof found*. +§3.1 step 4 judges both: the sidecar's proof locates GOPs 1 and 2 and recomputes them, **verified clip**, 1 and 2 of 3 — vector 89's verdict — which ranks above *frames not compared*, so it stands, with *manifest copy differs* and `proof_source` the sidecar. The source is vector 166: the container of vector 36's Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device's, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0) and `media.timing`, with each segment entry's timing hash (corpus 7.0.0); the clip bytes are vector 89's cut of it, under the same core. Rebuilt in corpus 6.0.0, when the 5.0.0 files carried vector 36's device proof, which predates `media.presentation`, and again in 7.0.0 over the core that binds timing. ## C2PA diff --git a/vectors/171-mp4-c2pa-foreign-proof-sidecar/expected.json b/vectors/171-mp4-c2pa-foreign-proof-sidecar/expected.json index 12c8935..4db021e 100644 --- a/vectors/171-mp4-c2pa-foreign-proof-sidecar/expected.json +++ b/vectors/171-mp4-c2pa-foreign-proof-sidecar/expected.json @@ -11,7 +11,7 @@ "origin not hardware-attested" ], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 1, diff --git a/vectors/171-mp4-c2pa-foreign-proof-sidecar/input.mp4 b/vectors/171-mp4-c2pa-foreign-proof-sidecar/input.mp4 index 82d4bea..1804f65 100644 Binary files a/vectors/171-mp4-c2pa-foreign-proof-sidecar/input.mp4 and b/vectors/171-mp4-c2pa-foreign-proof-sidecar/input.mp4 differ diff --git a/vectors/171-mp4-c2pa-foreign-proof-sidecar/input.mp4.vcap b/vectors/171-mp4-c2pa-foreign-proof-sidecar/input.mp4.vcap index d52b966..de23d0b 100644 --- a/vectors/171-mp4-c2pa-foreign-proof-sidecar/input.mp4.vcap +++ b/vectors/171-mp4-c2pa-foreign-proof-sidecar/input.mp4.vcap @@ -1 +1 @@ -{"capture_id":"QVfcJ4u5pNCzyZIz5CuQBA","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"strongbox"},"media":{"duration_ms":3008,"h":360,"hash":"kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM","mime":"video/mp4","presentation":{"config":"X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img","display":[41943040,23592960],"matrix":[65536,0,0,0,65536,0,0,0,1073741824]},"segment_count":3,"w":640},"segments":[{"gop":0,"hash":"nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY","prev":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","sig":"sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA"},{"gop":1,"hash":"24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8","prev":"xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc","sig":"0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg"},{"gop":2,"hash":"q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng","prev":"szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20","sig":"cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow"}],"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g"},"time":{"device_clock":1788955035726},"v":"vcap/1.0"} \ No newline at end of file +{"capture_id":"QVfcJ4u5pNCzyZIz5CuQBA","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"strongbox"},"media":{"duration_ms":3008,"h":360,"hash":"kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM","mime":"video/mp4","presentation":{"config":"5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc","display":[41943040,23592960],"matrix":[65536,0,0,0,65536,0,0,0,1073741824]},"segment_count":3,"timing":{"audio_timescale":48000,"root":"XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg","video_timescale":90000},"w":640},"segments":[{"gop":0,"hash":"nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY","prev":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","sig":"sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA","timing":"4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4"},{"gop":1,"hash":"24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8","prev":"xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc","sig":"0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg","timing":"DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU"},{"gop":2,"hash":"q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng","prev":"szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20","sig":"cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow","timing":"l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec"}],"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw"},"time":{"device_clock":1788955035726},"v":"vcap/1.0"} \ No newline at end of file diff --git a/vectors/171-mp4-c2pa-foreign-proof-sidecar/proof.json b/vectors/171-mp4-c2pa-foreign-proof-sidecar/proof.json index cbe0841..1f8d2d3 100644 --- a/vectors/171-mp4-c2pa-foreign-proof-sidecar/proof.json +++ b/vectors/171-mp4-c2pa-foreign-proof-sidecar/proof.json @@ -11,7 +11,7 @@ "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", "mime": "video/mp4", "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "display": [ 41943040, 23592960 @@ -29,6 +29,11 @@ ] }, "segment_count": 3, + "timing": { + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg", + "video_timescale": 90000 + }, "w": 640 }, "segments": [ @@ -36,25 +41,28 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g" + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw" }, "time": { "device_clock": 1788955035726 diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/NOTES.md b/vectors/173-mp4-container-foreign-trailer-sidecar/NOTES.md index 6cc9618..026587e 100644 --- a/vectors/173-mp4-container-foreign-trailer-sidecar/NOTES.md +++ b/vectors/173-mp4-container-foreign-trailer-sidecar/NOTES.md @@ -4,4 +4,4 @@ Vector 89's clip of vector 166 — GOP 0 removed — with its trailer stripped a §3.1 judges both over the same bytes, the file without the trailer: the sidecar's proof locates GOPs 1 and 2 and recomputes them, **verified clip**, 1 and 2 of 3 — vector 89's verdict — which ranks above *frames not compared*, so it stands, with *trailer copy differs* and `proof_source` the sidecar. Vector 171 is the same case with the foreign proof in a C2PA manifest. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/expected.json b/vectors/173-mp4-container-foreign-trailer-sidecar/expected.json index 1c9792b..84850d2 100644 --- a/vectors/173-mp4-container-foreign-trailer-sidecar/expected.json +++ b/vectors/173-mp4-container-foreign-trailer-sidecar/expected.json @@ -11,7 +11,7 @@ "trailer copy differs" ], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 1, diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4 b/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4 index f20a76f..3e0449c 100644 Binary files a/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4 and b/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4 differ diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4.vcap b/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4.vcap index d52b966..de23d0b 100644 --- a/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4.vcap +++ b/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4.vcap @@ -1 +1 @@ -{"capture_id":"QVfcJ4u5pNCzyZIz5CuQBA","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"strongbox"},"media":{"duration_ms":3008,"h":360,"hash":"kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM","mime":"video/mp4","presentation":{"config":"X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img","display":[41943040,23592960],"matrix":[65536,0,0,0,65536,0,0,0,1073741824]},"segment_count":3,"w":640},"segments":[{"gop":0,"hash":"nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY","prev":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","sig":"sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA"},{"gop":1,"hash":"24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8","prev":"xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc","sig":"0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg"},{"gop":2,"hash":"q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng","prev":"szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20","sig":"cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow"}],"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g"},"time":{"device_clock":1788955035726},"v":"vcap/1.0"} \ No newline at end of file +{"capture_id":"QVfcJ4u5pNCzyZIz5CuQBA","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"strongbox"},"media":{"duration_ms":3008,"h":360,"hash":"kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM","mime":"video/mp4","presentation":{"config":"5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc","display":[41943040,23592960],"matrix":[65536,0,0,0,65536,0,0,0,1073741824]},"segment_count":3,"timing":{"audio_timescale":48000,"root":"XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg","video_timescale":90000},"w":640},"segments":[{"gop":0,"hash":"nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY","prev":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","sig":"sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA","timing":"4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4"},{"gop":1,"hash":"24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8","prev":"xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc","sig":"0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg","timing":"DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU"},{"gop":2,"hash":"q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng","prev":"szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20","sig":"cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow","timing":"l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec"}],"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw"},"time":{"device_clock":1788955035726},"v":"vcap/1.0"} \ No newline at end of file diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/proof.json b/vectors/173-mp4-container-foreign-trailer-sidecar/proof.json index 2c15cda..eca07c3 100644 --- a/vectors/173-mp4-container-foreign-trailer-sidecar/proof.json +++ b/vectors/173-mp4-container-foreign-trailer-sidecar/proof.json @@ -9,7 +9,7 @@ "segment_count": 3, "w": 640, "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "matrix": [ 65536, 0, @@ -25,6 +25,11 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" } }, "device": { @@ -40,24 +45,27 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/175-mp4-timing-original/NOTES.md b/vectors/175-mp4-timing-original/NOTES.md new file mode 100644 index 0000000..b38497c --- /dev/null +++ b/vectors/175-mp4-timing-original/NOTES.md @@ -0,0 +1,7 @@ +# 175-mp4-timing-original + +Vector 166's file and proof, with the timing records spelled out. The core carries `media.timing` (§6.1): the `mdhd` timescales the muxer wrote (video 90 000, audio 48 000) and the root over the three segments' timing hashes; each `segments[]` entry carries `SHA-256(timing(n))` (§5 *Timing*). `debug.timing_records_hex` gives each `timing(n)` byte for byte — `uint32 v`, then `(int64 dts_i − dts_0 ‖ int64 cts_i) × v`, `uint64 end_n − dts_0`, `uint32 a`, `(int64 adts_j − adts_0 ‖ uint32 adur_j) × a` — so an implementation can compare its record before it compares a hash. + +What a real file puts in it: video durations that wander around 3000 ticks (one of 4885 where the encoder dropped a frame), no `ctts`, so every `cts_i` is 0; `end_n` of segment 2 is its last sample's DTS plus that sample's own duration; and the audio frames §5 assigns by DTS on the presentation timeline — the 473 ms empty edit on the video track included — each 1024 ticks. The video `mdhd` duration is not where `end_n` comes from: `MediaMuxer` wrote 260 759 ticks, the media plus the 473 ms delay, while the samples end at 218 178 — the value the media edit's `segment_duration` (24 242 at the 10 kHz movie timescale) agrees with. **Authentic**, every segment recomputed. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/175-mp4-timing-original/expected.json b/vectors/175-mp4-timing-original/expected.json new file mode 100644 index 0000000..fb91af9 --- /dev/null +++ b/vectors/175-mp4-timing-original/expected.json @@ -0,0 +1,41 @@ +{ + "kind": "container", + "outcome": "authentic", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested" + ], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [ + 0, + 1, + 2 + ] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true, + "debug": { + "video_timescale": 90000, + "audio_timescale": 48000, + "timing_records_hex": [ + "0000001e000000000000000000000000000000000000000000000bb800000000000000000000000000001770000000000000000000000000000023290000000000000000000000000000363e0000000000000000000000000000421200000000000000000000000000004daf000000000000000000000000000059b900000000000000000000000000006526000000000000000000000000000070d600000000000000000000000000007c9500000000000000000000000000008849000000000000000000000000000093fe00000000000000000000000000009fb60000000000000000000000000000ab6e0000000000000000000000000000b7270000000000000000000000000000c2de0000000000000000000000000000ce950000000000000000000000000000da510000000000000000000000000000e6050000000000000000000000000000f23d0000000000000000000000000000fd750000000000000000000000000001092d000000000000000000000000000114e5000000000000000000000000000121c700000000000000000000000000012d7f0000000000000000000000000001393d000000000000000000000000000144ef000000000000000000000000000150a700000000000000000000000000015c6000000000000000000000000000016817000000300000000000000000000004000000000000000400000004000000000000000800000004000000000000000c00000004000000000000001000000004000000000000001400000004000000000000001800000004000000000000001c00000004000000000000002000000004000000000000002400000004000000000000002800000004000000000000002c00000004000000000000003000000004000000000000003400000004000000000000003800000004000000000000003c00000004000000000000004000000004000000000000004400000004000000000000004800000004000000000000004c00000004000000000000005000000004000000000000005400000004000000000000005800000004000000000000005c00000004000000000000006000000004000000000000006400000004000000000000006800000004000000000000006c00000004000000000000007000000004000000000000007400000004000000000000007800000004000000000000007c00000004000000000000008000000004000000000000008400000004000000000000008800000004000000000000008c00000004000000000000009000000004000000000000009400000004000000000000009800000004000000000000009c0000000400000000000000a00000000400000000000000a40000000400000000000000a80000000400000000000000ac0000000400000000000000b00000000400000000000000b40000000400000000000000b80000000400000000000000bc0000000400", + "0000001e000000000000000000000000000000000000000000000bb70000000000000000000000000000176f0000000000000000000000000000232800000000000000000000000000002edf00000000000000000000000000003a970000000000000000000000000000464f0000000000000000000000000000520600000000000000000000000000005dbf000000000000000000000000000069760000000000000000000000000000752e000000000000000000000000000080e600000000000000000000000000008c9e000000000000000000000000000098560000000000000000000000000000a40e0000000000000000000000000000afc60000000000000000000000000000bb840000000000000000000000000000c7360000000000000000000000000000d2ee0000000000000000000000000000dea60000000000000000000000000000ea5d0000000000000000000000000000f61b000000000000000000000000000101cd00000000000000000000000000010d850000000000000000000000000001193e000000000000000000000000000124f5000000000000000000000000000130ad00000000000000000000000000013c640000000000000000000000000001481f000000000000000000000000000153d500000000000000000000000000015f8c0000002f0000000000000000000004000000000000000400000004000000000000000800000004000000000000000c00000004000000000000001000000004000000000000001400000004000000000000001800000004000000000000001c00000004000000000000002000000004000000000000002400000004000000000000002800000004000000000000002c00000004000000000000003000000004000000000000003400000004000000000000003800000004000000000000003c00000004000000000000004000000004000000000000004400000004000000000000004800000004000000000000004c00000004000000000000005000000004000000000000005400000004000000000000005800000004000000000000005c00000004000000000000006000000004000000000000006400000004000000000000006800000004000000000000006c00000004000000000000007000000004000000000000007400000004000000000000007800000004000000000000007c00000004000000000000008000000004000000000000008400000004000000000000008800000004000000000000008c00000004000000000000009000000004000000000000009400000004000000000000009800000004000000000000009c0000000400000000000000a00000000400000000000000a40000000400000000000000a80000000400000000000000ac0000000400000000000000b00000000400000000000000b40000000400000000000000b80000000400", + "0000000c000000000000000000000000000000000000000000000bb8000000000000000000000000000017700000000000000000000000000000232800000000000000000000000000002ee100000000000000000000000000003a99000000000000000000000000000046500000000000000000000000000000520800000000000000000000000000005dc0000000000000000000000000000069780000000000000000000000000000752f000000000000000000000000000080e700000000000000000000000000008c9f000000170000000000000000000004000000000000000400000004000000000000000800000004000000000000000c00000004000000000000001000000004000000000000001400000004000000000000001800000004000000000000001c00000004000000000000002000000004000000000000002400000004000000000000002800000004000000000000002c00000004000000000000003000000004000000000000003400000004000000000000003800000004000000000000003c00000004000000000000004000000004000000000000004400000004000000000000004800000004000000000000004c0000000400000000000000500000000400000000000000540000000400000000000000580000000400" + ], + "timing_hashes_hex": [ + "e1b6790b1826a9eff423566c9f45b057a9b2b697bcb8a7d14bdd363f43520e6e", + "0e906c2a7835cb617ebe9107fb5bc4e45aedf72716be83b183b1e28ed4c8f705", + "974c9aee6c3030fd3b0593868c5c70408819d5c21ad9113ee5c636699d69dc47" + ], + "root_hex": "5d6a9e6b011c73391db1d3dbab805c47c06ae7ea34685b27394c5a7f2562d108" + } +} diff --git a/vectors/175-mp4-timing-original/input.mp4 b/vectors/175-mp4-timing-original/input.mp4 new file mode 100644 index 0000000..b52567e Binary files /dev/null and b/vectors/175-mp4-timing-original/input.mp4 differ diff --git a/vectors/175-mp4-timing-original/proof.json b/vectors/175-mp4-timing-original/proof.json new file mode 100644 index 0000000..eca07c3 --- /dev/null +++ b/vectors/175-mp4-timing-original/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/176-mp4-timing-missing/NOTES.md b/vectors/176-mp4-timing-missing/NOTES.md new file mode 100644 index 0000000..97e6ccc --- /dev/null +++ b/vectors/176-mp4-timing-missing/NOTES.md @@ -0,0 +1,5 @@ +# 176-mp4-timing-missing + +Vector 175 with a core signed without `media.timing` and segment entries without `timing`: a writer that predates corpus 7.0.0. §6.1 and §8 require the field of every proof that carries `segments`, as they require `media.presentation`: the core is signed once and attached to every clip cut from it, so a field a clip depends on cannot be optional to the original. Missing required field — **no proof found**, before the signature is read (vector 165 is the same answer for `media.presentation`). + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/176-mp4-timing-missing/expected.json b/vectors/176-mp4-timing-missing/expected.json new file mode 100644 index 0000000..ee7996a --- /dev/null +++ b/vectors/176-mp4-timing-missing/expected.json @@ -0,0 +1,7 @@ +{ + "kind": "container", + "outcome": "no_proof_found", + "labels": [], + "not_evaluated": [], + "schema_valid": false +} diff --git a/vectors/176-mp4-timing-missing/input.mp4 b/vectors/176-mp4-timing-missing/input.mp4 new file mode 100644 index 0000000..a988017 Binary files /dev/null and b/vectors/176-mp4-timing-missing/input.mp4 differ diff --git a/vectors/176-mp4-timing-missing/proof.json b/vectors/176-mp4-timing-missing/proof.json new file mode 100644 index 0000000..e620b6c --- /dev/null +++ b/vectors/176-mp4-timing-missing/proof.json @@ -0,0 +1,63 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + } + ], + "sig": { + "alg": "ES256", + "value": "NzyCmQKbpMG1PKI3yJh33mBjavL6xSzSdLyzT34u60ApNUMB4yKVndkm3Eg93CVYbiT2g4k3C7H_jYmVi8WXwA", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/177-mp4-timing-entry-not-in-root/NOTES.md b/vectors/177-mp4-timing-entry-not-in-root/NOTES.md new file mode 100644 index 0000000..85f0a11 --- /dev/null +++ b/vectors/177-mp4-timing-entry-not-in-root/NOTES.md @@ -0,0 +1,5 @@ +# 177-mp4-timing-entry-not-in-root + +Vector 175 with segment 1's `timing` hash in the proof replaced after signing. The entry's `timing` is outside the 96-byte segment message and outside every signature: what binds it is `media.timing.root` in the signed core. With every entry present a verifier recomputes the root from the entries — no demuxer needed — and here it does not match: a binding the proof makes that does not hold, **tampered** (§5 *Timing*). `segments.verified` still lists the three GOPs whose content recomputes, as on vector 90: the contents are intact, the proof is not. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/177-mp4-timing-entry-not-in-root/expected.json b/vectors/177-mp4-timing-entry-not-in-root/expected.json new file mode 100644 index 0000000..df2d836 --- /dev/null +++ b/vectors/177-mp4-timing-entry-not-in-root/expected.json @@ -0,0 +1,15 @@ +{ + "kind": "container", + "outcome": "tampered", + "labels": [], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [ + 0, + 1, + 2 + ] + }, + "schema_valid": true +} diff --git a/vectors/177-mp4-timing-entry-not-in-root/input.mp4 b/vectors/177-mp4-timing-entry-not-in-root/input.mp4 new file mode 100644 index 0000000..27fa915 Binary files /dev/null and b/vectors/177-mp4-timing-entry-not-in-root/input.mp4 differ diff --git a/vectors/177-mp4-timing-entry-not-in-root/proof.json b/vectors/177-mp4-timing-entry-not-in-root/proof.json new file mode 100644 index 0000000..ecfd96a --- /dev/null +++ b/vectors/177-mp4-timing-entry-not-in-root/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "vNuB0oW0GZ_3mMNsBxGjOam-4SoHGH5932HGGfKuDzA" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/178-mp4-timing-clip-end-cut/NOTES.md b/vectors/178-mp4-timing-clip-end-cut/NOTES.md new file mode 100644 index 0000000..305b735 --- /dev/null +++ b/vectors/178-mp4-timing-clip-end-cut/NOTES.md @@ -0,0 +1,7 @@ +# 178-mp4-timing-clip-end-cut + +Vector 175 **cut at the end**: GOP 2 removed from the video track, and with it the audio frames §5 assigns to segment 2; the 473 ms empty edit, the timescales and the full proof stay. Segment 1 is the last segment of this file and was not the last of the original: its `end_n` is its last sample's DTS plus that sample's duration, which in the original was the DTS of IDR 2 — the same number, because a sample table has no other way to place IDR 2 — and its audio runs "to the end of the track", which is now the frames before IDR 2. The record reads back identical. A reader that took `end_n` from the track's end — the `mdhd` duration, which on this device counts the 473 ms delay and which `remux.ts` leaves at the original's — gets segment 1 wrong here. + +The video's media edit is the kept media rounded down into the 10 kHz movie timescale, so it ends less than one movie tick before segment 1 does — the slack §5 *Timing* allows, because a muxer has to round. **Verified clip**, 0 and 1 of 3. The cut at the start is vector 89, 1 and 2 of 3, with its timing kept. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/178-mp4-timing-clip-end-cut/expected.json b/vectors/178-mp4-timing-clip-end-cut/expected.json new file mode 100644 index 0000000..26749a3 --- /dev/null +++ b/vectors/178-mp4-timing-clip-end-cut/expected.json @@ -0,0 +1,25 @@ +{ + "kind": "container", + "outcome": "verified_clip", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested" + ], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [ + 0, + 1 + ] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true +} diff --git a/vectors/178-mp4-timing-clip-end-cut/input.mp4 b/vectors/178-mp4-timing-clip-end-cut/input.mp4 new file mode 100644 index 0000000..07dd848 Binary files /dev/null and b/vectors/178-mp4-timing-clip-end-cut/input.mp4 differ diff --git a/vectors/178-mp4-timing-clip-end-cut/proof.json b/vectors/178-mp4-timing-clip-end-cut/proof.json new file mode 100644 index 0000000..eca07c3 --- /dev/null +++ b/vectors/178-mp4-timing-clip-end-cut/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/179-mp4-timing-clip-frame-frozen/NOTES.md b/vectors/179-mp4-timing-clip-frame-frozen/NOTES.md new file mode 100644 index 0000000..89fc123 --- /dev/null +++ b/vectors/179-mp4-timing-clip-frame-frozen/NOTES.md @@ -0,0 +1,7 @@ +# 179-mp4-timing-clip-frame-frozen + +Vector 89's clip with one `stts` duration lengthened by two seconds: the sixth frame of segment 2 freezes on screen, then the recording resumes. Every sample, every vcap SEI and every audio frame is where it was, segment 2 is the last of the file so its audio still runs to the end of the track, and both GOPs recompute to their signed `content_hash` — before corpus 7.0.0 this file read *verified clip*, 1 and 2 of 3, with two seconds of a moment that never lasted two seconds. + +Segment 2's timing record read back has one `dts_i − dts_0` after the frozen frame larger by 180 000 ticks, and `end_n` with them: its hash is not the entry's. The signed frames under a timing nobody signed — **frames not compared**, *timing differs*, no segment credited (§5 *Timing*). Not *tampered*: re-muxing a clip is not an accusation. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/179-mp4-timing-clip-frame-frozen/expected.json b/vectors/179-mp4-timing-clip-frame-frozen/expected.json new file mode 100644 index 0000000..9b7a9be --- /dev/null +++ b/vectors/179-mp4-timing-clip-frame-frozen/expected.json @@ -0,0 +1,23 @@ +{ + "kind": "container", + "outcome": "frames_not_compared", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested", + "timing differs" + ], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true +} diff --git a/vectors/179-mp4-timing-clip-frame-frozen/input.mp4 b/vectors/179-mp4-timing-clip-frame-frozen/input.mp4 new file mode 100644 index 0000000..bec9c03 Binary files /dev/null and b/vectors/179-mp4-timing-clip-frame-frozen/input.mp4 differ diff --git a/vectors/179-mp4-timing-clip-frame-frozen/proof.json b/vectors/179-mp4-timing-clip-frame-frozen/proof.json new file mode 100644 index 0000000..eca07c3 --- /dev/null +++ b/vectors/179-mp4-timing-clip-frame-frozen/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/180-mp4-timing-clip-frames-reordered/NOTES.md b/vectors/180-mp4-timing-clip-frames-reordered/NOTES.md new file mode 100644 index 0000000..03fc494 --- /dev/null +++ b/vectors/180-mp4-timing-clip-frames-reordered/NOTES.md @@ -0,0 +1,7 @@ +# 180-mp4-timing-clip-frames-reordered + +Vector 89's clip with a `ctts` box added (version 1) that swaps the presentation of two frames inside segment 2: the clip's sample 33 is shown 3001 ticks late and sample 34 3001 ticks early, so a player shows them in each other's place. Decode order, every sample, every SEI and every audio frame are untouched; both GOPs recompute. Picture order count would catch this in a stream with B-frames, and neither sealer writes any: on their files there was nothing to check it against. + +Segment 2's record reads back with two `cts_i` that are not 0, where the signed record has 0 for every sample (the original has no `ctts`): **frames not compared**, *timing differs*, nothing credited (§5 *Timing*). + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/180-mp4-timing-clip-frames-reordered/expected.json b/vectors/180-mp4-timing-clip-frames-reordered/expected.json new file mode 100644 index 0000000..9b7a9be --- /dev/null +++ b/vectors/180-mp4-timing-clip-frames-reordered/expected.json @@ -0,0 +1,23 @@ +{ + "kind": "container", + "outcome": "frames_not_compared", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested", + "timing differs" + ], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true +} diff --git a/vectors/180-mp4-timing-clip-frames-reordered/input.mp4 b/vectors/180-mp4-timing-clip-frames-reordered/input.mp4 new file mode 100644 index 0000000..f9e6ba6 Binary files /dev/null and b/vectors/180-mp4-timing-clip-frames-reordered/input.mp4 differ diff --git a/vectors/180-mp4-timing-clip-frames-reordered/proof.json b/vectors/180-mp4-timing-clip-frames-reordered/proof.json new file mode 100644 index 0000000..eca07c3 --- /dev/null +++ b/vectors/180-mp4-timing-clip-frames-reordered/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/181-mp4-timing-clip-timescale-doubled/NOTES.md b/vectors/181-mp4-timing-clip-timescale-doubled/NOTES.md new file mode 100644 index 0000000..94ee5d6 --- /dev/null +++ b/vectors/181-mp4-timing-clip-timescale-doubled/NOTES.md @@ -0,0 +1,7 @@ +# 181-mp4-timing-clip-timescale-doubled + +Vector 89's clip with both tracks' `mdhd` timescales doubled (video 180 000, audio 96 000) and every `stts` duration kept, and the movie timescale doubled with them: the whole clip plays twice as fast, picture and sound in sync. Every instant on the presentation timeline is exactly half what it was, so §5 assigns the same audio frames to each segment and both GOPs recompute — the uniform rescale the audio rule could never see. + +Read back, the values are the signed ones, in a timescale that says they last half as long. Converted to the signed timescales, `t × 90 000 / 180 000` is not an integer for an odd duration (3001, 2999), and where it is it is half the signed value: either way the hash differs — **frames not compared**, *timing differs* (§5 *Timing*). Vector 182 is the re-mux that changes the timescale and keeps the instants. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/181-mp4-timing-clip-timescale-doubled/expected.json b/vectors/181-mp4-timing-clip-timescale-doubled/expected.json new file mode 100644 index 0000000..9b7a9be --- /dev/null +++ b/vectors/181-mp4-timing-clip-timescale-doubled/expected.json @@ -0,0 +1,23 @@ +{ + "kind": "container", + "outcome": "frames_not_compared", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested", + "timing differs" + ], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true +} diff --git a/vectors/181-mp4-timing-clip-timescale-doubled/input.mp4 b/vectors/181-mp4-timing-clip-timescale-doubled/input.mp4 new file mode 100644 index 0000000..cda6d67 Binary files /dev/null and b/vectors/181-mp4-timing-clip-timescale-doubled/input.mp4 differ diff --git a/vectors/181-mp4-timing-clip-timescale-doubled/proof.json b/vectors/181-mp4-timing-clip-timescale-doubled/proof.json new file mode 100644 index 0000000..eca07c3 --- /dev/null +++ b/vectors/181-mp4-timing-clip-timescale-doubled/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/182-mp4-timing-clip-exact-remux/NOTES.md b/vectors/182-mp4-timing-clip-exact-remux/NOTES.md new file mode 100644 index 0000000..be4534f --- /dev/null +++ b/vectors/182-mp4-timing-clip-exact-remux/NOTES.md @@ -0,0 +1,5 @@ +# 182-mp4-timing-clip-exact-remux + +Vector 89's clip re-muxed into finer ticks: both `mdhd` timescales doubled (video 180 000, audio 96 000) **and** every `stts` duration doubled with them, the empty edits unchanged. Every frame is shown at the instant it was, for as long as it was. A verifier converts each value read back into the signed timescale — `t_signed = t_received × ts_signed / ts_received`, here `2t × 90 000 / 180 000 = t`, an integer every time — and the records hash to the signed ones. **Verified clip**, 1 and 2 of 3: a re-mux that keeps or multiplies a timescale verifies exactly (§5 *Timing*), and only one that cannot represent the original instants reads *timing differs*. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/182-mp4-timing-clip-exact-remux/expected.json b/vectors/182-mp4-timing-clip-exact-remux/expected.json new file mode 100644 index 0000000..8708983 --- /dev/null +++ b/vectors/182-mp4-timing-clip-exact-remux/expected.json @@ -0,0 +1,25 @@ +{ + "kind": "container", + "outcome": "verified_clip", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested" + ], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [ + 1, + 2 + ] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true +} diff --git a/vectors/182-mp4-timing-clip-exact-remux/input.mp4 b/vectors/182-mp4-timing-clip-exact-remux/input.mp4 new file mode 100644 index 0000000..d87c9db Binary files /dev/null and b/vectors/182-mp4-timing-clip-exact-remux/input.mp4 differ diff --git a/vectors/182-mp4-timing-clip-exact-remux/proof.json b/vectors/182-mp4-timing-clip-exact-remux/proof.json new file mode 100644 index 0000000..eca07c3 --- /dev/null +++ b/vectors/182-mp4-timing-clip-exact-remux/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/183-mp4-timing-clip-audio-rate-changed/NOTES.md b/vectors/183-mp4-timing-clip-audio-rate-changed/NOTES.md new file mode 100644 index 0000000..1b3d687 --- /dev/null +++ b/vectors/183-mp4-timing-clip-audio-rate-changed/NOTES.md @@ -0,0 +1,5 @@ +# 183-mp4-timing-clip-audio-rate-changed + +Vector 89's clip with the AudioSpecificConfig inside the audio sample entry's `esds` changed from 48 kHz to 44.1 kHz (sampling frequency index 3 → 4, file byte 161183): the same coded frames now decode 8 % slower and lower in pitch, while every `stts` duration, every timescale and every byte a segment hashes are untouched — the timing record reads back identical. What a decoder is told about the audio is presentation: since corpus 7.0.0 the audio sample entry's `esds` is part of `X` in `media.presentation.config` (§5 *Presentation*), so the configuration hash read back differs — **frames not compared**, *presentation differs*, nothing credited. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/183-mp4-timing-clip-audio-rate-changed/expected.json b/vectors/183-mp4-timing-clip-audio-rate-changed/expected.json new file mode 100644 index 0000000..acdde55 --- /dev/null +++ b/vectors/183-mp4-timing-clip-audio-rate-changed/expected.json @@ -0,0 +1,23 @@ +{ + "kind": "container", + "outcome": "frames_not_compared", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested", + "presentation differs" + ], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true +} diff --git a/vectors/183-mp4-timing-clip-audio-rate-changed/input.mp4 b/vectors/183-mp4-timing-clip-audio-rate-changed/input.mp4 new file mode 100644 index 0000000..864598a Binary files /dev/null and b/vectors/183-mp4-timing-clip-audio-rate-changed/input.mp4 differ diff --git a/vectors/183-mp4-timing-clip-audio-rate-changed/proof.json b/vectors/183-mp4-timing-clip-audio-rate-changed/proof.json new file mode 100644 index 0000000..eca07c3 --- /dev/null +++ b/vectors/183-mp4-timing-clip-audio-rate-changed/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/184-mp4-timing-clip-edit-trims-segment/NOTES.md b/vectors/184-mp4-timing-clip-edit-trims-segment/NOTES.md new file mode 100644 index 0000000..a100ef5 --- /dev/null +++ b/vectors/184-mp4-timing-clip-edit-trims-segment/NOTES.md @@ -0,0 +1,7 @@ +# 184-mp4-timing-clip-edit-trims-segment + +Vector 89's clip with the video track's single media edit shortened by 0.2 s: `segment_duration` ends inside segment 2, so a player stops showing it six frames early. The edit list keeps the shape §5 models — leading empty edit, one media edit at rate 1 — so every GOP is located and recomputes, and every timing record reads back as signed: the sample tables are vector 89's. What changed is how much of segment 2 is shown. + +§5 *Timing*: on a clip, a single media edit that starts after a located segment's first presented instant, or ends one movie tick or more before its last frame does, trims inside it — a subset of the signed frames under a timing nobody signed. **Frames not compared**, *timing differs*. An original is not read this way: `media.hash` covers its edit list with every other byte. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/184-mp4-timing-clip-edit-trims-segment/expected.json b/vectors/184-mp4-timing-clip-edit-trims-segment/expected.json new file mode 100644 index 0000000..9b7a9be --- /dev/null +++ b/vectors/184-mp4-timing-clip-edit-trims-segment/expected.json @@ -0,0 +1,23 @@ +{ + "kind": "container", + "outcome": "frames_not_compared", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested", + "timing differs" + ], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true +} diff --git a/vectors/184-mp4-timing-clip-edit-trims-segment/input.mp4 b/vectors/184-mp4-timing-clip-edit-trims-segment/input.mp4 new file mode 100644 index 0000000..59175c1 Binary files /dev/null and b/vectors/184-mp4-timing-clip-edit-trims-segment/input.mp4 differ diff --git a/vectors/184-mp4-timing-clip-edit-trims-segment/proof.json b/vectors/184-mp4-timing-clip-edit-trims-segment/proof.json new file mode 100644 index 0000000..eca07c3 --- /dev/null +++ b/vectors/184-mp4-timing-clip-edit-trims-segment/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/185-mp4-timing-original-misdescribed/NOTES.md b/vectors/185-mp4-timing-original-misdescribed/NOTES.md new file mode 100644 index 0000000..63e050f --- /dev/null +++ b/vectors/185-mp4-timing-original-misdescribed/NOTES.md @@ -0,0 +1,7 @@ +# 185-mp4-timing-original-misdescribed + +Vector 175's file under a core whose `media.timing` was computed from the encoder's presentation timestamps in microseconds — `video_timescale` and `audio_timescale` 1 000 000, every value rounded to the microsecond — instead of from the ticks the muxer wrote: the mistake §5's writer requirements forbid, made by a writer that hashed before muxing. The proof is consistent with itself (the root recomputes from the entries) and does not describe the file: converted into microseconds, `3000 × 1 000 000 / 90 000` is not an integer, so no segment's record reads back as signed. + +The bytes are exactly the sealed ones — `media.hash` matches — so the outcome stays **authentic**, and the false claim is the writer's: *timing differs*, amber at best, the way vector 163 is *presentation differs* (§5 *Timing*, §7). A writer conformance suite catches it on its first file. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/185-mp4-timing-original-misdescribed/expected.json b/vectors/185-mp4-timing-original-misdescribed/expected.json new file mode 100644 index 0000000..c98900c --- /dev/null +++ b/vectors/185-mp4-timing-original-misdescribed/expected.json @@ -0,0 +1,27 @@ +{ + "kind": "container", + "outcome": "authentic", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested", + "timing differs" + ], + "not_evaluated": [], + "core_hash": "e7714bab1a3c431b8bebffbe7aa6b942ad3ad471874e6e683bb7986749fbbc16", + "segments": { + "verified": [ + 0, + 1, + 2 + ] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true +} diff --git a/vectors/185-mp4-timing-original-misdescribed/input.mp4 b/vectors/185-mp4-timing-original-misdescribed/input.mp4 new file mode 100644 index 0000000..6b7abd4 Binary files /dev/null and b/vectors/185-mp4-timing-original-misdescribed/input.mp4 differ diff --git a/vectors/185-mp4-timing-original-misdescribed/proof.json b/vectors/185-mp4-timing-original-misdescribed/proof.json new file mode 100644 index 0000000..431e20d --- /dev/null +++ b/vectors/185-mp4-timing-original-misdescribed/proof.json @@ -0,0 +1,71 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 1000000, + "audio_timescale": 1000000, + "root": "j462rRJp87qZyti4hBlDZidklnyJ57bPy2PSN9JKmn0" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "jyQyCOvIgLuEU9SmN16nA3QOHKa4qxJSjScEWWZytZQ" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "tbqXZiNUCXE47XFFhpPrIvPZJTTo8f1Fx_jI0PGlFpQ" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "jwvMeez41Fuft1EpbLdDcG4yO1M4K6_X77gMdOGREH0" + } + ], + "sig": { + "alg": "ES256", + "value": "Bjx6rQy7WFLCV589caR8ZSn2GRyQyabIqz9z43HtWmUqeGg7GZpw9Tfu0Z2NnNTL0xIjsm428UbiD1M-TNztzw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/186-mp4-timing-clip-entry-dropped/NOTES.md b/vectors/186-mp4-timing-clip-entry-dropped/NOTES.md new file mode 100644 index 0000000..4fe4f89 --- /dev/null +++ b/vectors/186-mp4-timing-clip-entry-dropped/NOTES.md @@ -0,0 +1,7 @@ +# 186-mp4-timing-clip-entry-dropped + +Vector 89's clip — GOP 0 cut — with entry 0 dropped from the proof as well: the proof a cutter makes when it keeps only the entries of the segments it kept. Every remaining signature holds, GOPs 1 and 2 are located and recompute, and their timing reads back as their entries say. But the entries' `timing` hashes are outside every signature: only `media.timing.root` binds them, and the root is over all `segment_count` of them. With entry 0 gone it cannot be recomputed, so nothing shows entries 1 and 2 are the ones the sealer wrote — anyone could have rewritten them to match a re-timed clip. + +§5 *Timing*: a clip's proof carries every entry, and a located segment whose timing hash is not authenticated by the root is not shown at signed instants — **frames not compared**, *timing differs*. Before corpus 7.0.0 this file read *verified clip*, 1 and 2 of 3, as vector 89 does. Vector 38 drops the same entry over the original file and reads *tampered* for an earlier reason: GOP 0 is in the file and nothing signs it. + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/186-mp4-timing-clip-entry-dropped/expected.json b/vectors/186-mp4-timing-clip-entry-dropped/expected.json new file mode 100644 index 0000000..9b7a9be --- /dev/null +++ b/vectors/186-mp4-timing-clip-entry-dropped/expected.json @@ -0,0 +1,23 @@ +{ + "kind": "container", + "outcome": "frames_not_compared", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested", + "timing differs" + ], + "not_evaluated": [], + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", + "segments": { + "verified": [] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "schema_valid": true +} diff --git a/vectors/186-mp4-timing-clip-entry-dropped/input.mp4 b/vectors/186-mp4-timing-clip-entry-dropped/input.mp4 new file mode 100644 index 0000000..47d1ae7 Binary files /dev/null and b/vectors/186-mp4-timing-clip-entry-dropped/input.mp4 differ diff --git a/vectors/186-mp4-timing-clip-entry-dropped/proof.json b/vectors/186-mp4-timing-clip-entry-dropped/proof.json new file mode 100644 index 0000000..8e5785d --- /dev/null +++ b/vectors/186-mp4-timing-clip-entry-dropped/proof.json @@ -0,0 +1,64 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/187-mp4-timing-entry-hash-missing/NOTES.md b/vectors/187-mp4-timing-entry-hash-missing/NOTES.md new file mode 100644 index 0000000..5c23ed3 --- /dev/null +++ b/vectors/187-mp4-timing-entry-hash-missing/NOTES.md @@ -0,0 +1,5 @@ +# 187-mp4-timing-entry-hash-missing + +Vector 175 with the `timing` member removed from segment 1's entry after signing. §6.1 makes it a required member of every `segments[]` entry, as `hash`, `prev` and `sig` are: a proof whose entry lacks it is not well formed — **no proof found**, before any signature is read, the answer a missing `media.w` gets after signing (vector 46). + +The container is vector 36's Android capture (Samsung SM-S908B, H.264 with an AAC track) under vector 166's re-signed core, which carries `media.timing` (corpus 7.0.0). Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/187-mp4-timing-entry-hash-missing/expected.json b/vectors/187-mp4-timing-entry-hash-missing/expected.json new file mode 100644 index 0000000..ee7996a --- /dev/null +++ b/vectors/187-mp4-timing-entry-hash-missing/expected.json @@ -0,0 +1,7 @@ +{ + "kind": "container", + "outcome": "no_proof_found", + "labels": [], + "not_evaluated": [], + "schema_valid": false +} diff --git a/vectors/187-mp4-timing-entry-hash-missing/input.mp4 b/vectors/187-mp4-timing-entry-hash-missing/input.mp4 new file mode 100644 index 0000000..48b06d5 Binary files /dev/null and b/vectors/187-mp4-timing-entry-hash-missing/input.mp4 differ diff --git a/vectors/187-mp4-timing-entry-hash-missing/proof.json b/vectors/187-mp4-timing-entry-hash-missing/proof.json new file mode 100644 index 0000000..026ad18 --- /dev/null +++ b/vectors/187-mp4-timing-entry-hash-missing/proof.json @@ -0,0 +1,70 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" + } + ], + "sig": { + "alg": "ES256", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/33-mp4-video-sealed/NOTES.md b/vectors/33-mp4-video-sealed/NOTES.md index 4b01d98..c73661b 100644 --- a/vectors/33-mp4-video-sealed/NOTES.md +++ b/vectors/33-mp4-video-sealed/NOTES.md @@ -1,6 +1,6 @@ # 33-mp4-video-sealed -An ISO-BMFF video with media.mime video/mp4, segment_count 3 and the complete chain of vector 25 in the trailer (flag SEGMENTS set). Canonical bytes are the file minus the trailer (§4.1) and `media.hash` matches, so the file is the one the device sealed: **authentic**. The chain is checked at message level only — this is a `file` vector, the container is not demuxed — and the verdict says so with *segment content not recomputed* (§7). +An ISO-BMFF video with media.mime video/mp4, segment_count 3 and the complete chain of vector 25 in the trailer (flag SEGMENTS set). Like its content hashes, the chain's timing hashes are synthetic — no GOP of this file is behind them — and `media.timing.root` is over them: a `file` vector checks the root against the entries and nothing against the container (§5 *Timing*). Canonical bytes are the file minus the trailer (§4.1) and `media.hash` matches, so the file is the one the device sealed: **authentic**. The chain is checked at message level only — this is a `file` vector, the container is not demuxed — and the verdict says so with *segment content not recomputed* (§7). `segments.verified` is **empty**, and that is the rule of §5 (*Locating segments*): a segment counts as verified only once a GOP of this file has been located and its `content_hash` recomputed. Here the signatures hold and nothing was compared; the file is authentic because `media.hash` covers every byte, not because any segment was checked. Vectors 38, 39, 86-94 and 166-168 are the same question asked of the container. diff --git a/vectors/33-mp4-video-sealed/expected.json b/vectors/33-mp4-video-sealed/expected.json index c83bb10..c95bd2d 100644 --- a/vectors/33-mp4-video-sealed/expected.json +++ b/vectors/33-mp4-video-sealed/expected.json @@ -12,7 +12,7 @@ "watermark not evaluated" ], "not_evaluated": [], - "core_hash": "86b7e6b1cd8e8efa66e07a671b3aedf0da87adc241ddc01de89d7005e3570a0e", + "core_hash": "dbb4319495bb48d7e46e7c939aa7cf253dacd0c185c368d251a266a2d4a3661b", "segments": { "verified": [] }, diff --git a/vectors/33-mp4-video-sealed/input.mp4 b/vectors/33-mp4-video-sealed/input.mp4 index 590642d..ceb1b51 100644 Binary files a/vectors/33-mp4-video-sealed/input.mp4 and b/vectors/33-mp4-video-sealed/input.mp4 differ diff --git a/vectors/33-mp4-video-sealed/proof.json b/vectors/33-mp4-video-sealed/proof.json index 2d64774..d9600af 100644 --- a/vectors/33-mp4-video-sealed/proof.json +++ b/vectors/33-mp4-video-sealed/proof.json @@ -25,6 +25,10 @@ 1048576, 1048576 ] + }, + "timing": { + "video_timescale": 15360, + "root": "8SAPN2RGHS4YHJ-twVgYB8u60ybfYxgfKbtoPbZKYD8" } }, "device": { @@ -57,24 +61,27 @@ "gop": 0, "hash": "kr6s8q6y81Fz3F_6xL4M-VVslfHElaTY-iVP8ZNSMk8", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "gT1cQ8_T7x-wqXTUlrwaeBaaDI2hwLEbUq8LiLmjjN0ageN0YFn4n3h5MM9StoXLhr29GYUCH0-9OHO335VNaQ" + "sig": "gT1cQ8_T7x-wqXTUlrwaeBaaDI2hwLEbUq8LiLmjjN0ageN0YFn4n3h5MM9StoXLhr29GYUCH0-9OHO335VNaQ", + "timing": "nbJ9cqptnj645RNcf22FZr17a2kZ_MgaNOwUKHvm_pw" }, { "gop": 1, "hash": "3q0FJMsh2sAgYapRbubMFw_LjQsWg5LzPptUVqwz9kI", "prev": "lPuR8oUo-FkoxlMOR3MUQgRLVVZ9mzRm1VXfF2nxMUk", - "sig": "o1NDn-dd6ta2gtxe1A3UZY2mD1flCdixblH6Zqe7O2gSfvITDZ8gRgdvXaOJGl_mUdVyEOLic81NGo2V1q8BmQ" + "sig": "o1NDn-dd6ta2gtxe1A3UZY2mD1flCdixblH6Zqe7O2gSfvITDZ8gRgdvXaOJGl_mUdVyEOLic81NGo2V1q8BmQ", + "timing": "hg2oEf9nXS7AlZF--88P2gB4VqWdMkbmvQv_7QAdXSU" }, { "gop": 2, "hash": "9eBHdAvSkalXlM0lAO-pJeKwaNtM-qxGKaL_cjReqHA", "prev": "3DCOQWFjD3ktTMnczAe0MpvrYjS1fMakVD1Z21mq_f8", - "sig": "ECzio8byd1rCeEVVq8hn_AlLn_sZHO-4zJr4CSRI9rZm34XdQjHWyp0e3BEURASIXY2iXmqgoDwzNDiAhaSJGw" + "sig": "ECzio8byd1rCeEVVq8hn_AlLn_sZHO-4zJr4CSRI9rZm34XdQjHWyp0e3BEURASIXY2iXmqgoDwzNDiAhaSJGw", + "timing": "4N7Gn0gEs6bj0p9A9Qiui7S_s9vd275Wx8NKQxUdW_g" } ], "sig": { "alg": "ES256", - "value": "mO16jdYNHa9MTyJu6OKigKYWITUlqu0EcC_5QRT4-2J-qpl4uW0k8OsrFLCy1qpLc-lumVhpNBpgQwvoS8BpjQ", + "value": "UrfbWQ9VRwjySjqU1BM0q1yaE2YO51mDEfXYKrwzlzMerB5Jk5v0CsK5w7od2e1R-UUG6Eo62lC5VgXUxN7cTg", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/38-mp4-container-clip/NOTES.md b/vectors/38-mp4-container-clip/NOTES.md index db97857..d631f1f 100644 --- a/vectors/38-mp4-container-clip/NOTES.md +++ b/vectors/38-mp4-container-clip/NOTES.md @@ -4,4 +4,4 @@ The file of vector 36 with the entry for segment 0 removed from the **proof** an **Tampered**, 1 and 2 verified. GOP 0 carries a vcap SEI naming segment 0, and the proof signs no segment 0: that GOP is content no signature covers (§5, *Locating segments*). It is exactly the file an attacker produces by prepending a forged GOP to a genuine clip whose first segment is gone, and before the binding rule it read *verified clip*, 1 and 2, with the unsigned frames on screen. The genuine clip — the GOP cut from the file, the proof whole — is vector 89. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/38-mp4-container-clip/expected.json b/vectors/38-mp4-container-clip/expected.json index 23b96f9..1189a55 100644 --- a/vectors/38-mp4-container-clip/expected.json +++ b/vectors/38-mp4-container-clip/expected.json @@ -3,7 +3,7 @@ "outcome": "tampered", "labels": [], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 1, diff --git a/vectors/38-mp4-container-clip/input.mp4 b/vectors/38-mp4-container-clip/input.mp4 index b991da8..3a44e05 100644 Binary files a/vectors/38-mp4-container-clip/input.mp4 and b/vectors/38-mp4-container-clip/input.mp4 differ diff --git a/vectors/38-mp4-container-clip/proof.json b/vectors/38-mp4-container-clip/proof.json index 2fda179..8e5785d 100644 --- a/vectors/38-mp4-container-clip/proof.json +++ b/vectors/38-mp4-container-clip/proof.json @@ -9,7 +9,7 @@ "segment_count": 3, "w": 640, "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "matrix": [ 65536, 0, @@ -25,6 +25,11 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" } }, "device": { @@ -40,18 +45,20 @@ "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/39-mp4-container-frame-replaced/NOTES.md b/vectors/39-mp4-container-frame-replaced/NOTES.md index c7a29db..46f27e1 100644 --- a/vectors/39-mp4-container-frame-replaced/NOTES.md +++ b/vectors/39-mp4-container-frame-replaced/NOTES.md @@ -6,4 +6,4 @@ Every signature still verifies, because a signature covers the hash a writer dec Without this vector the corpus cannot tell a verifier that recomputes from one that does not: without the recomputation the same file reads *frames not compared*. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/39-mp4-container-frame-replaced/expected.json b/vectors/39-mp4-container-frame-replaced/expected.json index bd3e40e..e74600c 100644 --- a/vectors/39-mp4-container-frame-replaced/expected.json +++ b/vectors/39-mp4-container-frame-replaced/expected.json @@ -3,7 +3,7 @@ "outcome": "tampered", "labels": [], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 0, diff --git a/vectors/39-mp4-container-frame-replaced/input.mp4 b/vectors/39-mp4-container-frame-replaced/input.mp4 index 1c9756a..b0ff53b 100644 Binary files a/vectors/39-mp4-container-frame-replaced/input.mp4 and b/vectors/39-mp4-container-frame-replaced/input.mp4 differ diff --git a/vectors/39-mp4-container-frame-replaced/proof.json b/vectors/39-mp4-container-frame-replaced/proof.json index 2c15cda..eca07c3 100644 --- a/vectors/39-mp4-container-frame-replaced/proof.json +++ b/vectors/39-mp4-container-frame-replaced/proof.json @@ -9,7 +9,7 @@ "segment_count": 3, "w": 640, "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "matrix": [ 65536, 0, @@ -25,6 +25,11 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" } }, "device": { @@ -40,24 +45,27 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/86-mp4-container-stolen-proof-sidecar/NOTES.md b/vectors/86-mp4-container-stolen-proof-sidecar/NOTES.md index 690b0ec..0510c93 100644 --- a/vectors/86-mp4-container-stolen-proof-sidecar/NOTES.md +++ b/vectors/86-mp4-container-stolen-proof-sidecar/NOTES.md @@ -4,4 +4,4 @@ The proof of vector 36, as a sidecar, next to an unrelated recording — vector The outcome is **frames not compared**: the signatures hold and nothing ties them to the frames in front of the reader. Never *verified clip* — a clip is frames that were compared — and this is the case that read *verified clip* with segments 0, 1 and 2 before the binding rule existed, because a GOP that no SEI of this capture names was skipped rather than counted against the file. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/86-mp4-container-stolen-proof-sidecar/expected.json b/vectors/86-mp4-container-stolen-proof-sidecar/expected.json index 60d2cca..059c5f1 100644 --- a/vectors/86-mp4-container-stolen-proof-sidecar/expected.json +++ b/vectors/86-mp4-container-stolen-proof-sidecar/expected.json @@ -10,7 +10,7 @@ "origin not hardware-attested" ], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [] }, diff --git a/vectors/86-mp4-container-stolen-proof-sidecar/input.mp4.vcap b/vectors/86-mp4-container-stolen-proof-sidecar/input.mp4.vcap index d52b966..de23d0b 100644 --- a/vectors/86-mp4-container-stolen-proof-sidecar/input.mp4.vcap +++ b/vectors/86-mp4-container-stolen-proof-sidecar/input.mp4.vcap @@ -1 +1 @@ -{"capture_id":"QVfcJ4u5pNCzyZIz5CuQBA","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"strongbox"},"media":{"duration_ms":3008,"h":360,"hash":"kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM","mime":"video/mp4","presentation":{"config":"X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img","display":[41943040,23592960],"matrix":[65536,0,0,0,65536,0,0,0,1073741824]},"segment_count":3,"w":640},"segments":[{"gop":0,"hash":"nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY","prev":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","sig":"sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA"},{"gop":1,"hash":"24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8","prev":"xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc","sig":"0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg"},{"gop":2,"hash":"q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng","prev":"szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20","sig":"cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow"}],"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g"},"time":{"device_clock":1788955035726},"v":"vcap/1.0"} \ No newline at end of file +{"capture_id":"QVfcJ4u5pNCzyZIz5CuQBA","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"strongbox"},"media":{"duration_ms":3008,"h":360,"hash":"kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM","mime":"video/mp4","presentation":{"config":"5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc","display":[41943040,23592960],"matrix":[65536,0,0,0,65536,0,0,0,1073741824]},"segment_count":3,"timing":{"audio_timescale":48000,"root":"XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg","video_timescale":90000},"w":640},"segments":[{"gop":0,"hash":"nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY","prev":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","sig":"sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA","timing":"4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4"},{"gop":1,"hash":"24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8","prev":"xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc","sig":"0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg","timing":"DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU"},{"gop":2,"hash":"q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng","prev":"szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20","sig":"cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow","timing":"l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec"}],"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw"},"time":{"device_clock":1788955035726},"v":"vcap/1.0"} \ No newline at end of file diff --git a/vectors/86-mp4-container-stolen-proof-sidecar/proof.json b/vectors/86-mp4-container-stolen-proof-sidecar/proof.json index 2c15cda..eca07c3 100644 --- a/vectors/86-mp4-container-stolen-proof-sidecar/proof.json +++ b/vectors/86-mp4-container-stolen-proof-sidecar/proof.json @@ -9,7 +9,7 @@ "segment_count": 3, "w": 640, "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "matrix": [ 65536, 0, @@ -25,6 +25,11 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" } }, "device": { @@ -40,24 +45,27 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/87-mp4-container-proof-over-unmarked-video/NOTES.md b/vectors/87-mp4-container-proof-over-unmarked-video/NOTES.md index e5b7183..8a3c547 100644 --- a/vectors/87-mp4-container-proof-over-unmarked-video/NOTES.md +++ b/vectors/87-mp4-container-proof-over-unmarked-video/NOTES.md @@ -4,4 +4,4 @@ The proof of vector 36 as a sidecar over `_media/base.mp4`, a two-frame H.264 fi A verifier MUST NOT fall back to position — the first GOP of the file is not segment 0 of a proof just because it comes first (§5). -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/87-mp4-container-proof-over-unmarked-video/expected.json b/vectors/87-mp4-container-proof-over-unmarked-video/expected.json index 60d2cca..059c5f1 100644 --- a/vectors/87-mp4-container-proof-over-unmarked-video/expected.json +++ b/vectors/87-mp4-container-proof-over-unmarked-video/expected.json @@ -10,7 +10,7 @@ "origin not hardware-attested" ], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [] }, diff --git a/vectors/87-mp4-container-proof-over-unmarked-video/input.mp4.vcap b/vectors/87-mp4-container-proof-over-unmarked-video/input.mp4.vcap index d52b966..de23d0b 100644 --- a/vectors/87-mp4-container-proof-over-unmarked-video/input.mp4.vcap +++ b/vectors/87-mp4-container-proof-over-unmarked-video/input.mp4.vcap @@ -1 +1 @@ -{"capture_id":"QVfcJ4u5pNCzyZIz5CuQBA","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"strongbox"},"media":{"duration_ms":3008,"h":360,"hash":"kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM","mime":"video/mp4","presentation":{"config":"X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img","display":[41943040,23592960],"matrix":[65536,0,0,0,65536,0,0,0,1073741824]},"segment_count":3,"w":640},"segments":[{"gop":0,"hash":"nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY","prev":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","sig":"sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA"},{"gop":1,"hash":"24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8","prev":"xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc","sig":"0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg"},{"gop":2,"hash":"q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng","prev":"szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20","sig":"cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow"}],"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g"},"time":{"device_clock":1788955035726},"v":"vcap/1.0"} \ No newline at end of file +{"capture_id":"QVfcJ4u5pNCzyZIz5CuQBA","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"strongbox"},"media":{"duration_ms":3008,"h":360,"hash":"kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM","mime":"video/mp4","presentation":{"config":"5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc","display":[41943040,23592960],"matrix":[65536,0,0,0,65536,0,0,0,1073741824]},"segment_count":3,"timing":{"audio_timescale":48000,"root":"XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg","video_timescale":90000},"w":640},"segments":[{"gop":0,"hash":"nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY","prev":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","sig":"sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA","timing":"4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4"},{"gop":1,"hash":"24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8","prev":"xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc","sig":"0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg","timing":"DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU"},{"gop":2,"hash":"q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng","prev":"szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20","sig":"cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow","timing":"l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec"}],"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw"},"time":{"device_clock":1788955035726},"v":"vcap/1.0"} \ No newline at end of file diff --git a/vectors/87-mp4-container-proof-over-unmarked-video/proof.json b/vectors/87-mp4-container-proof-over-unmarked-video/proof.json index 2c15cda..eca07c3 100644 --- a/vectors/87-mp4-container-proof-over-unmarked-video/proof.json +++ b/vectors/87-mp4-container-proof-over-unmarked-video/proof.json @@ -9,7 +9,7 @@ "segment_count": 3, "w": 640, "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "matrix": [ 65536, 0, @@ -25,6 +25,11 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" } }, "device": { @@ -40,24 +45,27 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/88-mp4-container-sei-index-altered/NOTES.md b/vectors/88-mp4-container-sei-index-altered/NOTES.md index ae6d59c..9d1d1f7 100644 --- a/vectors/88-mp4-container-sei-index-altered/NOTES.md +++ b/vectors/88-mp4-container-sei-index-altered/NOTES.md @@ -4,4 +4,4 @@ Vector 36 with one byte changed: the index in the second GOP's vcap SEI, 1 → 3 **Tampered**, with segments 0 and 2 verified: a GOP whose SEI index is not a signed segment is content no signature covers (§5). Before the binding rule this file read *verified clip* with 0, 1 and 2 — segment 1 counted as verified because its signature held, though no GOP of the file was ever compared with it. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/88-mp4-container-sei-index-altered/expected.json b/vectors/88-mp4-container-sei-index-altered/expected.json index bd3e40e..e74600c 100644 --- a/vectors/88-mp4-container-sei-index-altered/expected.json +++ b/vectors/88-mp4-container-sei-index-altered/expected.json @@ -3,7 +3,7 @@ "outcome": "tampered", "labels": [], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 0, diff --git a/vectors/88-mp4-container-sei-index-altered/input.mp4 b/vectors/88-mp4-container-sei-index-altered/input.mp4 index 4cd7b46..59c9bef 100644 Binary files a/vectors/88-mp4-container-sei-index-altered/input.mp4 and b/vectors/88-mp4-container-sei-index-altered/input.mp4 differ diff --git a/vectors/88-mp4-container-sei-index-altered/proof.json b/vectors/88-mp4-container-sei-index-altered/proof.json index 2c15cda..eca07c3 100644 --- a/vectors/88-mp4-container-sei-index-altered/proof.json +++ b/vectors/88-mp4-container-sei-index-altered/proof.json @@ -9,7 +9,7 @@ "segment_count": 3, "w": 640, "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "matrix": [ 65536, 0, @@ -25,6 +25,11 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" } }, "device": { @@ -40,24 +45,27 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/89-mp4-container-cut-clip/NOTES.md b/vectors/89-mp4-container-cut-clip/NOTES.md index 47a34e8..4354dc2 100644 --- a/vectors/89-mp4-container-cut-clip/NOTES.md +++ b/vectors/89-mp4-container-cut-clip/NOTES.md @@ -2,8 +2,8 @@ Vector 36 **cut**: its first GOP removed from the video track, the audio frames before the cut removed with it, and the full proof — all three segments — still in the trailer. This is what a clip is: the file lacks segment 0, the proof does not. -Every surviving sample keeps its instant on the movie timeline (the movie timescale becomes 90 kHz and each track gets an empty edit for the time that was cut), so §5's audio rule assigns the same frames to segments 1 and 2 as in the original, and both recompute. `remux.ts` copies the decoder configuration, the track header and the track layout as they were, so the clip presents its frames as the core's `media.presentation` says (§5 *Presentation*). **Verified clip**, 1 and 2 of 3. Segment 0 is signed and absent, which is the clip case and never *tampered*; `media.hash` does not match, which is what says this is not the original. +Every surviving sample keeps its instant on the movie timeline (the movie timescale becomes 90 kHz and each track gets an empty edit for the time that was cut), so §5's audio rule assigns the same frames to segments 1 and 2 as in the original, and both recompute. `remux.ts` copies the decoder configuration, the track header and the track layout as they were, so the clip presents its frames as the core's `media.presentation` says (§5 *Presentation*); and it keeps every `stts` duration and both timescales, so each segment's timing record reads back as `media.timing` binds it (§5 *Timing*). **Verified clip**, 1 and 2 of 3. Segment 0 is signed and absent, which is the clip case and never *tampered*; `media.hash` does not match, which is what says this is not the original. Vector 38 removed segment 0 from the **proof** and left it in the file; under the binding rule that is a GOP no signature covers, and it reads *tampered*. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/89-mp4-container-cut-clip/expected.json b/vectors/89-mp4-container-cut-clip/expected.json index 4f5a119..8708983 100644 --- a/vectors/89-mp4-container-cut-clip/expected.json +++ b/vectors/89-mp4-container-cut-clip/expected.json @@ -10,7 +10,7 @@ "origin not hardware-attested" ], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 1, diff --git a/vectors/89-mp4-container-cut-clip/input.mp4 b/vectors/89-mp4-container-cut-clip/input.mp4 index 3efbf3c..6940d02 100644 Binary files a/vectors/89-mp4-container-cut-clip/input.mp4 and b/vectors/89-mp4-container-cut-clip/input.mp4 differ diff --git a/vectors/89-mp4-container-cut-clip/proof.json b/vectors/89-mp4-container-cut-clip/proof.json index 2c15cda..eca07c3 100644 --- a/vectors/89-mp4-container-cut-clip/proof.json +++ b/vectors/89-mp4-container-cut-clip/proof.json @@ -9,7 +9,7 @@ "segment_count": 3, "w": 640, "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "matrix": [ 65536, 0, @@ -25,6 +25,11 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" } }, "device": { @@ -40,24 +45,27 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/90-mp4-container-gops-reordered/NOTES.md b/vectors/90-mp4-container-gops-reordered/NOTES.md index 259ddd0..7670c20 100644 --- a/vectors/90-mp4-container-gops-reordered/NOTES.md +++ b/vectors/90-mp4-container-gops-reordered/NOTES.md @@ -4,4 +4,4 @@ Vector 37 with its last two GOPs swapped in decode order: segment 0, then 2, the And the file is **tampered**: vcap SEI indices MUST be strictly increasing in decode order (§5). The chain proves the order of the *messages*; only this rule proves the order of the *frames*, and without it a verifier would accept any shuffle of a signed recording as long as each piece was genuine. Vector 26 asked this question at message level, where no file had to be read. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/90-mp4-container-gops-reordered/expected.json b/vectors/90-mp4-container-gops-reordered/expected.json index 81571e6..2af31c2 100644 --- a/vectors/90-mp4-container-gops-reordered/expected.json +++ b/vectors/90-mp4-container-gops-reordered/expected.json @@ -3,7 +3,7 @@ "outcome": "tampered", "labels": [], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [ 0, diff --git a/vectors/90-mp4-container-gops-reordered/input.mp4 b/vectors/90-mp4-container-gops-reordered/input.mp4 index 8a3309a..6a59954 100644 Binary files a/vectors/90-mp4-container-gops-reordered/input.mp4 and b/vectors/90-mp4-container-gops-reordered/input.mp4 differ diff --git a/vectors/90-mp4-container-gops-reordered/proof.json b/vectors/90-mp4-container-gops-reordered/proof.json index bb8f248..5465fe4 100644 --- a/vectors/90-mp4-container-gops-reordered/proof.json +++ b/vectors/90-mp4-container-gops-reordered/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/91-mp4-container-gop-duplicated/NOTES.md b/vectors/91-mp4-container-gop-duplicated/NOTES.md index a369176..1ff635f 100644 --- a/vectors/91-mp4-container-gop-duplicated/NOTES.md +++ b/vectors/91-mp4-container-gop-duplicated/NOTES.md @@ -2,4 +2,4 @@ Vector 37 with its second GOP played twice: 0, 1, 1, 2. Both copies of segment 1 recompute to its signed hash. A signed segment counts only when **exactly one** GOP of the file carries its index (§5), so segment 1 is not verified, and a duplicated index is **tampered** — a recording in which one second of footage appears twice is not the recording that was signed, however genuine each copy is. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/91-mp4-container-gop-duplicated/expected.json b/vectors/91-mp4-container-gop-duplicated/expected.json index b8c0225..a94df71 100644 --- a/vectors/91-mp4-container-gop-duplicated/expected.json +++ b/vectors/91-mp4-container-gop-duplicated/expected.json @@ -3,7 +3,7 @@ "outcome": "tampered", "labels": [], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [ 0, diff --git a/vectors/91-mp4-container-gop-duplicated/input.mp4 b/vectors/91-mp4-container-gop-duplicated/input.mp4 index 6a943b5..1ce990a 100644 Binary files a/vectors/91-mp4-container-gop-duplicated/input.mp4 and b/vectors/91-mp4-container-gop-duplicated/input.mp4 differ diff --git a/vectors/91-mp4-container-gop-duplicated/proof.json b/vectors/91-mp4-container-gop-duplicated/proof.json index bb8f248..5465fe4 100644 --- a/vectors/91-mp4-container-gop-duplicated/proof.json +++ b/vectors/91-mp4-container-gop-duplicated/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/92-mp4-container-nal-length-overrun/NOTES.md b/vectors/92-mp4-container-nal-length-overrun/NOTES.md index 7be572b..b6b2452 100644 --- a/vectors/92-mp4-container-nal-length-overrun/NOTES.md +++ b/vectors/92-mp4-container-nal-length-overrun/NOTES.md @@ -2,4 +2,4 @@ Vector 37 with the first NAL length prefix of the second sample of GOP 1 increased by one (file byte 53360), so the units no longer tile the sample. The NAL units of a sample MUST cover it exactly (§5): a verifier that stopped at the first length that does not fit — which the reference verifier used to do — would leave the rest of the sample out of every hash and still call the GOP verified. **Tampered**, and no segment is credited: a malformed container is not a partial answer. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/92-mp4-container-nal-length-overrun/expected.json b/vectors/92-mp4-container-nal-length-overrun/expected.json index ec9abd4..a3be1e2 100644 --- a/vectors/92-mp4-container-nal-length-overrun/expected.json +++ b/vectors/92-mp4-container-nal-length-overrun/expected.json @@ -3,7 +3,7 @@ "outcome": "tampered", "labels": [], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [] }, diff --git a/vectors/92-mp4-container-nal-length-overrun/input.mp4 b/vectors/92-mp4-container-nal-length-overrun/input.mp4 index 4114706..d9f8d52 100644 Binary files a/vectors/92-mp4-container-nal-length-overrun/input.mp4 and b/vectors/92-mp4-container-nal-length-overrun/input.mp4 differ diff --git a/vectors/92-mp4-container-nal-length-overrun/proof.json b/vectors/92-mp4-container-nal-length-overrun/proof.json index bb8f248..5465fe4 100644 --- a/vectors/92-mp4-container-nal-length-overrun/proof.json +++ b/vectors/92-mp4-container-nal-length-overrun/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/93-mp4-container-sei-extra-message/NOTES.md b/vectors/93-mp4-container-sei-extra-message/NOTES.md index 9d47760..4d81d83 100644 --- a/vectors/93-mp4-container-sei-extra-message/NOTES.md +++ b/vectors/93-mp4-container-sei-extra-message/NOTES.md @@ -4,4 +4,4 @@ Vector 36 with the vcap SEI NAL of GOP 1 rebuilt to carry a **second** SEI messa **Tampered**, 0 and 2 verified. The sample is rewritten through `remux.ts` (it grew by twenty-two bytes) and the audio track is untouched. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/93-mp4-container-sei-extra-message/expected.json b/vectors/93-mp4-container-sei-extra-message/expected.json index bd3e40e..e74600c 100644 --- a/vectors/93-mp4-container-sei-extra-message/expected.json +++ b/vectors/93-mp4-container-sei-extra-message/expected.json @@ -3,7 +3,7 @@ "outcome": "tampered", "labels": [], "not_evaluated": [], - "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "core_hash": "e51545cc157b4125752b406d9caea656d0da9b729532b2592442fb58024b1a24", "segments": { "verified": [ 0, diff --git a/vectors/93-mp4-container-sei-extra-message/input.mp4 b/vectors/93-mp4-container-sei-extra-message/input.mp4 index 8aa1992..69de03d 100644 Binary files a/vectors/93-mp4-container-sei-extra-message/input.mp4 and b/vectors/93-mp4-container-sei-extra-message/input.mp4 differ diff --git a/vectors/93-mp4-container-sei-extra-message/proof.json b/vectors/93-mp4-container-sei-extra-message/proof.json index 2c15cda..eca07c3 100644 --- a/vectors/93-mp4-container-sei-extra-message/proof.json +++ b/vectors/93-mp4-container-sei-extra-message/proof.json @@ -9,7 +9,7 @@ "segment_count": 3, "w": 640, "presentation": { - "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "config": "5pxMIBuI6pcGBXn4m6o_wvJkiq6CObsazbsrEHp2ANc", "matrix": [ 65536, 0, @@ -25,6 +25,11 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "audio_timescale": 48000, + "root": "XWqeawEcczkdsdPbq4BcR8Bq5-o0aFsnOUxafyVi0Qg" } }, "device": { @@ -40,24 +45,27 @@ "gop": 0, "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA", + "timing": "4bZ5Cxgmqe_0I1Zsn0WwV6mytpe8uKfRS902P0NSDm4" }, { "gop": 1, "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", - "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg", + "timing": "DpBsKng1y2F-vpEH-1vE5Frt9ycWvoOxg7HijtTI9wU" }, { "gop": 2, "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", - "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow", + "timing": "l0ya7mwwMP07BZOGjFxwQIgZ1cIa2RE-5cY2aZ1p3Ec" } ], "sig": { "alg": "ES256", - "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "value": "qznaar3z_UEu7WDUgT_FpLnWA2RPqwpuJd6vJHC_Qk5phjLLuT8_ElvjPEUoFVQkBikyrvjUM5PxVGb1m_wQRw", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/94-mp4-container-sync-table-not-idr/NOTES.md b/vectors/94-mp4-container-sync-table-not-idr/NOTES.md index 507a0c5..2ff4c10 100644 --- a/vectors/94-mp4-container-sync-table-not-idr/NOTES.md +++ b/vectors/94-mp4-container-sync-table-not-idr/NOTES.md @@ -4,4 +4,4 @@ Vector 37 with its sync sample table rewritten to mark **every** sample as a syn The real-world version of this trap is HEVC's CRA picture: a random-access point `stss` lists that is not an IDR. -Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation` and `media.timing` (both read back from the device's container), which the device proof predates (corpora 5.0.0 and 7.0.0). diff --git a/vectors/94-mp4-container-sync-table-not-idr/expected.json b/vectors/94-mp4-container-sync-table-not-idr/expected.json index d766f62..b1b409d 100644 --- a/vectors/94-mp4-container-sync-table-not-idr/expected.json +++ b/vectors/94-mp4-container-sync-table-not-idr/expected.json @@ -10,7 +10,7 @@ "origin not hardware-attested" ], "not_evaluated": [], - "core_hash": "b93395d8a811f5b2511a9ce4009518b6b662a54ce0e12c3afb10c903cbe81b83", + "core_hash": "cb67c5896327ef557f8a3eef698283cf31d69f108e4e623e5fcc7ce6c85f5720", "segments": { "verified": [ 0, diff --git a/vectors/94-mp4-container-sync-table-not-idr/input.mp4 b/vectors/94-mp4-container-sync-table-not-idr/input.mp4 index 1a062ac..90c5e47 100644 Binary files a/vectors/94-mp4-container-sync-table-not-idr/input.mp4 and b/vectors/94-mp4-container-sync-table-not-idr/input.mp4 differ diff --git a/vectors/94-mp4-container-sync-table-not-idr/proof.json b/vectors/94-mp4-container-sync-table-not-idr/proof.json index bb8f248..5465fe4 100644 --- a/vectors/94-mp4-container-sync-table-not-idr/proof.json +++ b/vectors/94-mp4-container-sync-table-not-idr/proof.json @@ -25,6 +25,10 @@ 41943040, 23592960 ] + }, + "timing": { + "video_timescale": 90000, + "root": "X6O0fZE1KBVlFbzAcEVZLim5FWBHXyDT6HXvAunWeik" } }, "device": { @@ -40,24 +44,27 @@ "gop": 0, "hash": "-2E994jlyo0tKVkOsVQKp7nL67dpx24vCul8FygSBiM", "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g" + "sig": "6B9K8BXHG1oazx2AlEu58k9ggmJLeISXTqT8qZx9VPZaM0rJLWmpH7_ulRN196gRk2I844bd5nSogvLj9erG-g", + "timing": "oGjOSpLvmzJ_RrUy8zq6U-bfXueuB-c94awu-1o_ad0" }, { "gop": 1, "hash": "rYDoB6k98qzKYFgI1oxF6ny8YL4hXNkN7v2mEtjr4T8", "prev": "_KpvKO2buL-Zv23fxtgvesfH3iMsIrEUWYpig8N3GyY", - "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ" + "sig": "T76UNeQ_iSIObRuFLi_5cZIexsUKNr3X2FOC9pzaVFVGfsVlTY936NuOz-5Iz5-7pECkUAi509_TrBiN5rbkAQ", + "timing": "uutPOdMPxm6S2V1VUCZGyFoN6vf6UaKjxQnM3CRkg1A" }, { "gop": 2, "hash": "reWmdHb2TVHHAAgw72CbD7_khCpFCA8x-Q5etji002A", "prev": "jk9_AbU9gywwSnSxTTI11mjB8a8Zx9CO-8BAqkt_79s", - "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q" + "sig": "1208D-ZpbelkjLbKZBfPXRmjydhSs51KDgF6IXBFcsYGJyUTPLFCpcaztTvrIuDUiyx0pGnMDx303_w9J-Rc_Q", + "timing": "B7kRuDjNnFJQUk8GD6GR7Ms-3rEOSQOeLPOK46BlkXA" } ], "sig": { "alg": "ES256", - "value": "FSutTzidYonm2T3t3pTxVYrK3jFbMsc93kxjRCfO8xIFwukeNLbaVaSnI-qD8A6etFCZUBdkWKvmXTHWPNBtDw", + "value": "v2CrnppUkk3dzZNA1ZiaIIifOOzxrGLuy8_4sch7VGIopZffeAknRtvj6tNv7FvsTgdE_UvNSrThJV5BtphP6w", "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" } } diff --git a/vectors/CONFORMANCE.md b/vectors/CONFORMANCE.md index 48fdca3..1cf7b78 100644 --- a/vectors/CONFORMANCE.md +++ b/vectors/CONFORMANCE.md @@ -1,6 +1,6 @@ # Claiming conformance with a vcap-spec corpus -This file says what the sentence *"conformant with vcap-spec corpus 6.2.0"* +This file says what the sentence *"conformant with vcap-spec corpus 7.0.0"* has to mean for a consumer to be able to check it, and how to produce the report that backs it. `README.md` next to it describes the vectors themselves; this one is about the claim. @@ -30,7 +30,7 @@ Two corollaries, and they are what a reviewer should check in someone else's runner: - **Pin the count, do not floor it.** `expect(count).toBeGreaterThanOrEqual(30)` - over a corpus of 174 hides the loss of 144 vectors. Compare against + over a corpus of 187 hides the loss of 157 vectors. Compare against `vector_count` in `MANIFEST.json` and fail on inequality — that also catches the corpus that is newer than the runner, which is the useful half. - **A vector you cannot run is declared, not dropped.** A runner that has no @@ -47,11 +47,11 @@ reference verifier, measured against the corpus in the same commit. ```json { "implementation": "acme-verify 3.2 (https://example.invalid/acme-verify)", - "corpus_version": "6.2.0", + "corpus_version": "7.0.0", "manifest_sha256": "…64 hex…", - "vectors_declared": 174, - "vectors_run": 174, - "passed": 174, + "vectors_declared": 187, + "vectors_run": 187, + "passed": 187, "failed": [], "not_run": [] } @@ -106,5 +106,5 @@ be read and re-implemented rather than imported. arithmetic and `vectors/_watermark/agreement-floor.json` for the 0.85 floor a `video-rep-v1` decoder must not report an id below. - **Not a claim about a newer corpus.** A minor bump adds vectors and a - major one moves some (`README.md`, *Bump policy*), so passing corpus 6.2.0 - says nothing about a later corpus, and everything about 6.2.0's. State the version you ran. + major one moves some (`README.md`, *Bump policy*), so passing corpus 7.0.0 + says nothing about a later corpus, and everything about 7.0.0's. State the version you ran. diff --git a/vectors/MANIFEST.json b/vectors/MANIFEST.json index 0ee81d9..e4a12e9 100644 --- a/vectors/MANIFEST.json +++ b/vectors/MANIFEST.json @@ -1,6 +1,6 @@ { - "corpus_version": "6.2.0", - "vector_count": 174, + "corpus_version": "7.0.0", + "vector_count": 187, "vectors": [ { "name": "01-jpeg-sealed", @@ -229,7 +229,7 @@ "name": "33-mp4-video-sealed", "kind": "file", "outcome": "authentic", - "sha256": "c8f3f8a5efd29032b6d2b28405d783ce815f640358a23f845411e0e0eb1d9b27", + "sha256": "55e3087ae143d48bc8fe9fd114db8ddd26bb489af48eaf65ff8fa1b0e37f41d6", "files": 4 }, { @@ -264,14 +264,14 @@ "name": "38-mp4-container-clip", "kind": "container", "outcome": "tampered", - "sha256": "ca0066b7a9f52c083f00089ba7eb0e1846472997685debd12fc14bcfa4ca3f97", + "sha256": "4b411f99b1ea93d86be89e91954664d223975d68cf822bcb68292de1885f840c", "files": 4 }, { "name": "39-mp4-container-frame-replaced", "kind": "container", "outcome": "tampered", - "sha256": "84eab049567f3854cb54fa1c7b9507bdea60b813ed5c27c23c4cf60b3d5f8bb5", + "sha256": "9110b2232cd15a836f19f713fa5be2b96c04d47b373cafad6fbd37c9ac3ea7be", "files": 4 }, { @@ -600,63 +600,63 @@ "name": "86-mp4-container-stolen-proof-sidecar", "kind": "container", "outcome": "frames_not_compared", - "sha256": "38fbb0063626814f9d2c1514a22854d46497503c58b6ed754f6a177017a092cb", + "sha256": "22eeec7a0d13a286f1c1dc02dbfc245375e1ea30e3e80ba5a0e3cd48dcef54ce", "files": 5 }, { "name": "87-mp4-container-proof-over-unmarked-video", "kind": "container", "outcome": "frames_not_compared", - "sha256": "8d61bd106ac4ebda97fa90680880161c83fa436659a678e5bfa88fb2327da6c2", + "sha256": "e461a449408f2bbbb626f973a7c27a537a8fdef3eaa81c72ab5818b2a7c0ba3c", "files": 5 }, { "name": "88-mp4-container-sei-index-altered", "kind": "container", "outcome": "tampered", - "sha256": "54337c47078c245cc6beeb0cb37025fe9819ffb1dd4d6543e147536710d5098c", + "sha256": "b1a90421ba53d4d10398419f6fd1995feedf008586f251d465a12ed671ecf7e0", "files": 4 }, { "name": "89-mp4-container-cut-clip", "kind": "container", "outcome": "verified_clip", - "sha256": "0ab9a0658b180634e95e208a1f770aa125abefeadd38e7cc3b28ee3b65fe9fd4", + "sha256": "dce2c9b5f21412d74f40e98ba66ea6f3a11129c3f071b13e5a04cfdaddee1b2c", "files": 4 }, { "name": "90-mp4-container-gops-reordered", "kind": "container", "outcome": "tampered", - "sha256": "94042a18b0ca83d819b1ed8f80962cf99f4ca77f388074289246b1c85d1efdbe", + "sha256": "77d62fd5b96a07aebad8e96e5ac11f9495db5d8e0de4a09009de54df6231ef49", "files": 4 }, { "name": "91-mp4-container-gop-duplicated", "kind": "container", "outcome": "tampered", - "sha256": "17fa3a3884a8d7d5a3b70ce75fc992fead3237aa4e606166f14efd0e1dd2e45b", + "sha256": "b858ebfafa99a657561be97367bd27f7b6ebe5ff7302de5ae1f0436fa8a418d7", "files": 4 }, { "name": "92-mp4-container-nal-length-overrun", "kind": "container", "outcome": "tampered", - "sha256": "7d0ab066d0d3dff2f17eb6e71594a91a525d6806d2f2a43db26cc04374f7d978", + "sha256": "5f59c8b6e2022b1f1f7dd74f6ccf6f6beb9d315dbd0a81eb1d30d62f2798d0d6", "files": 4 }, { "name": "93-mp4-container-sei-extra-message", "kind": "container", "outcome": "tampered", - "sha256": "4220cc83e86ecbeec14889614ea7d7cb2c93d043641a43928c4b487533b3e2ee", + "sha256": "3190641618a41be652903e83d64963f6a1d9e83f33095ccb41d5c2244b05def4", "files": 4 }, { "name": "94-mp4-container-sync-table-not-idr", "kind": "container", "outcome": "verified_clip", - "sha256": "3d544c73582dbae474c382e72334ffd30a14783d5c3680f78393cbe94ea0d367", + "sha256": "2581bb0664161fa2203becc95be5cc2f3fe8bef9743ed3ea3216bdf4f7ca4f7e", "files": 4 }, { @@ -998,35 +998,35 @@ "name": "143-mp4-c2pa-free-excluded", "kind": "file", "outcome": "authentic", - "sha256": "4f06489ba8ee54298c9405920ddb4cdf5d771aa7cb9428180651b5c37bc7e247", + "sha256": "98787c8a9e9e7f7d0c67b795f338a65a564644195755477c614c49cd6864e760", "files": 4 }, { "name": "144-mp4-c2pa-free-hashed", "kind": "file", "outcome": "authentic", - "sha256": "664bfec78c4c4e3b66b5e0b17ed3c87603c50a44248e58c50af0f2f537b66425", + "sha256": "f0c6298a3c8c55f7af519ac247d6babbcc0b3b80ad982976247ab1f9ceddc459", "files": 4 }, { "name": "145-mp4-c2pa-clip-parent-of", "kind": "container", "outcome": "verified_clip", - "sha256": "13c443b68eb5a034a4e6ab23867b36bb2224643b7e637efb3344778ee0b89f37", + "sha256": "ad8a38f83b6b6e079e40ff2038d57fe5eba9992041b1dcb181a43c2c663a101a", "files": 4 }, { "name": "146-mp4-c2pa-clip-gop-replaced", "kind": "container", "outcome": "tampered", - "sha256": "af440e10d4739698fef110c918c132898acac13799eaf8107a9897cd91f247fa", + "sha256": "e4cf0dd20ecf9d9ad630bebd2bfa203d3f8e64162ba291543919f03d79e99d7c", "files": 4 }, { "name": "147-mp4-c2pa-clip-reencoded", "kind": "container", "outcome": "no_proof_found", - "sha256": "53c49233901c155e81264d8def9325148c996bd9c11ce5d028787a2e695d9093", + "sha256": "4fccc4701ac58dc488168948217e552402f7d1ae965a15eb5a3f45d813bcb186", "files": 4 }, { @@ -1089,7 +1089,7 @@ "name": "156-mp4-container-edit-list-reorders", "kind": "container", "outcome": "frames_not_compared", - "sha256": "16f9787d91d1a4d9514051f05ddb39e7a786d1c6ade3bcc006df8941f9ee4c1d", + "sha256": "5615ae641c4e886ee07b549aa38c036d0eae0627e7e211fe47d9718abb5ed45e", "files": 4 }, { @@ -1103,42 +1103,42 @@ "name": "158-mp4-presentation-original", "kind": "container", "outcome": "authentic", - "sha256": "96f6dc665dc233eaa5e2faa5284bf829d1d36a00db685c4dba8e25a00d2087fd", + "sha256": "7c478dda01defe1ab2a09aa8bdef526be8d285c560b9f18fa34db338ad82500b", "files": 4 }, { "name": "159-mp4-presentation-clip", "kind": "container", "outcome": "verified_clip", - "sha256": "4713cd32f70632711af67e274b8d7132b224a31215644fb2e1b8963a6668c997", + "sha256": "ff3c5ba238e76752457e59d67bcb04a5689be18bb95cfbc1c4af8ff8e29a8581", "files": 4 }, { "name": "160-mp4-presentation-clip-rotated", "kind": "container", "outcome": "frames_not_compared", - "sha256": "9db883c98c5e8959c8486d69250d1d6201dca8f05cb86aeed01fe1a1c64868db", + "sha256": "15b33165b0711869a37e0bc00ba9d910c94be60bfaf2c1c4d34d1c365f90950e", "files": 4 }, { "name": "161-mp4-presentation-clip-sps-edited", "kind": "container", "outcome": "frames_not_compared", - "sha256": "6178f6d837bb1d7f6d911924f6d1b1fe5958043943a8666f6cc13c23cd7f1cf7", + "sha256": "4658ebce29c58f3d62b2632ce1ae1baaee51196d6f173fb01382459f5564b29f", "files": 4 }, { "name": "162-mp4-presentation-clip-extra-track", "kind": "container", "outcome": "frames_not_compared", - "sha256": "e403c2d6edc13486b913aacecaf26887bd052a1d6570f1c9c291a33461dc4a23", + "sha256": "2acfccf35e53c474903870d512d3cdf1e8636b16cd08e5a2a2cfa396608e762c", "files": 4 }, { "name": "163-mp4-presentation-original-misdescribed", "kind": "container", "outcome": "authentic", - "sha256": "71a3f063ad2437c0eec178bdfc76ab63d379856d4e49560063674669e58dafa1", + "sha256": "da3167777ac595b272c92b02b922c44c1cd64e774e7b0b9cf3c25165c9d4c1ee", "files": 4 }, { @@ -1152,28 +1152,28 @@ "name": "165-mp4-video-without-presentation", "kind": "file", "outcome": "no_proof_found", - "sha256": "3a42008da7c2de1d749e16d426102e12f975869ad30a8f797e655973e66f9fe1", + "sha256": "cb3a4f1494fef884ab42f181abdcca3a423552adb2f241ddacaea54f4a8afe26", "files": 4 }, { "name": "166-mp4-container-h264-presentation", "kind": "container", "outcome": "authentic", - "sha256": "710f2dbc76a936404d6f06bef626515d32875dfda458a3ec3a0dd3f5a93e6107", + "sha256": "f6df0f16e593351827bb7f13561d3cc86b74581cc5676bc685adeeb792698e66", "files": 4 }, { "name": "167-mov-container-ios-presentation", "kind": "container", "outcome": "authentic", - "sha256": "6f9443929b44e3c2a0871284e6bf89f2afa6152d711ecb450d7c992c42a32456", + "sha256": "f0f1731f50dae253934c4df9438f28c97e1379c63a5204b454f892ef5b86c79b", "files": 4 }, { "name": "168-mp4-container-ios-presentation", "kind": "container", "outcome": "authentic", - "sha256": "dfc8861276889a5900e66d552772ecaec96bf641dc798bee82d186c934fac411", + "sha256": "19f7b512eef210a240891d621ee35818c57f9760f519ef7163b99784bbd0fce4", "files": 4 }, { @@ -1194,7 +1194,7 @@ "name": "171-mp4-c2pa-foreign-proof-sidecar", "kind": "container", "outcome": "verified_clip", - "sha256": "b83b96d7c648f4a668166a10fa210e46517d3fd87f0057e9841c16adc81d2daf", + "sha256": "d27d775fcbf51df0298d1e8c012fd696fe7277e6c7414d41f0250367abc2384b", "files": 5 }, { @@ -1208,7 +1208,7 @@ "name": "173-mp4-container-foreign-trailer-sidecar", "kind": "container", "outcome": "verified_clip", - "sha256": "b1ded8090640c4cbbb4d03531eb49fb4144f63f4982a0d882a074e3d7c0ed916", + "sha256": "0825b9ad927412a8a93e34c01fe88e66575659195569364de9a085f153076f3e", "files": 5 }, { @@ -1217,6 +1217,97 @@ "outcome": "tampered", "sha256": "a4b4815d2d12d68bc02689d32171a1d087ed4881104a0de0fe28524e19d7f7a1", "files": 5 + }, + { + "name": "175-mp4-timing-original", + "kind": "container", + "outcome": "authentic", + "sha256": "e914166265ee3b12f4570c416a0ac1b11e306a99a77c4d5c88b4e85523007e2a", + "files": 4 + }, + { + "name": "176-mp4-timing-missing", + "kind": "container", + "outcome": "no_proof_found", + "sha256": "78acd07731c0ec8993120e9879517b9dc4f629545c07d46f3bfaf154bb14ad52", + "files": 4 + }, + { + "name": "177-mp4-timing-entry-not-in-root", + "kind": "container", + "outcome": "tampered", + "sha256": "6deb37e9f64bbdd5f7b7991fe7897690e0871e326057c73106941f209048a895", + "files": 4 + }, + { + "name": "178-mp4-timing-clip-end-cut", + "kind": "container", + "outcome": "verified_clip", + "sha256": "bcb3920b150aa775d21ee8ae35d296835f8813618889e5a0ea718d52c083e011", + "files": 4 + }, + { + "name": "179-mp4-timing-clip-frame-frozen", + "kind": "container", + "outcome": "frames_not_compared", + "sha256": "77f3f4934b5e23ad38fc5f1012bda1dc737a42925c20bc04e7412f66789483e9", + "files": 4 + }, + { + "name": "180-mp4-timing-clip-frames-reordered", + "kind": "container", + "outcome": "frames_not_compared", + "sha256": "fbd1edffc9fac375c474cbe5ace17d7aae637ea71ca625bf496dd1af0ca0ab03", + "files": 4 + }, + { + "name": "181-mp4-timing-clip-timescale-doubled", + "kind": "container", + "outcome": "frames_not_compared", + "sha256": "58fcf9b9734f61b8cffb6d7cce61049ac8c00008cd10e6494d49444a0d25fc2c", + "files": 4 + }, + { + "name": "182-mp4-timing-clip-exact-remux", + "kind": "container", + "outcome": "verified_clip", + "sha256": "03c42b5841adbdf0136a0cd32771a257b80e64571582b8e7f6d9c2d6bca0df54", + "files": 4 + }, + { + "name": "183-mp4-timing-clip-audio-rate-changed", + "kind": "container", + "outcome": "frames_not_compared", + "sha256": "36dd31ee580f291f86107529da6f23221cb5caaa3511fc9aed5cc25b5e8c5538", + "files": 4 + }, + { + "name": "184-mp4-timing-clip-edit-trims-segment", + "kind": "container", + "outcome": "frames_not_compared", + "sha256": "1581f3e4d94feeb3751410b9b22e94406a0503d26515041aa09a29cad12b3f13", + "files": 4 + }, + { + "name": "185-mp4-timing-original-misdescribed", + "kind": "container", + "outcome": "authentic", + "sha256": "884c765d648b99e07b182e9875a9c6ffe6b5c81bb137c191952650e410bff82e", + "files": 4 + }, + { + "name": "186-mp4-timing-clip-entry-dropped", + "kind": "container", + "outcome": "frames_not_compared", + "sha256": "916a25d22041b3e00a43af683485a1b26135e5f220af515a465337209c2df5d2", + "files": 4 + }, + { + "name": "187-mp4-timing-entry-hash-missing", + "kind": "container", + "outcome": "no_proof_found", + "sha256": "5a3338472007f3165cd632f7fe41677c528f1142189ec48ec2593a83be8361e1", + "files": 4 } ], "fixtures": { diff --git a/vectors/README.md b/vectors/README.md index e4d80af..2a42953 100644 --- a/vectors/README.md +++ b/vectors/README.md @@ -35,14 +35,15 @@ every certificate path was validated at, and what proved it) appear on the vectors that carry attestation evidence. `location` (§7.1: `claimed`, the level the core asks for, and `level`, the one the evidence reaches — `none`, `declared`, `corroborated`, `authenticated`) appears on the position vectors -(74–84, 151) and on 47, 86, 87, 89, 166 and 168, which declare no position -and pin `none`. +(74–84, 151) and on 47, 86, 87, 89, 166, 168, 175 and 178–186, which declare +no position and pin `none`. `proof_source` (where the proof was read: `trailer`, `sidecar`, or `c2pa` with the carrying manifest's label and its depth on the `parentOf` chain) and `frames_name_capture` (whether a GOP of the file names the proof's capture) appear on the carrier vectors (123–147, 169–171) and on 172–174, and are compared where present. `debug`, where present, is for humans: intermediate bytes to compare before -touching signatures. +touching signatures (the 96-byte segment messages of 25, the timing records of +175). Two fields are **not** a verdict and a reader never compares them. `writer` is for writer suites: `{"expect": "refuse", "error": "VCAP_C2PA_MANIFEST_PRESENT"}` @@ -56,7 +57,8 @@ the error it refuses the file with. It is there so that nobody writes a C2PA promise the library does not keep — c2pa-rs reports `assertion.bmffHash.additionalExclusionsPresent` for `/free` and `/skip`, and `signingCredential.ocsp.skipped` on every file — and each vector's `NOTES.md` -adds what c2patool 0.28.0 says. +adds what c2patool says, with its version (0.28.0 for most, 0.27.16 for the +ISO-BMFF vectors re-minted in corpora 6.0.0 and 7.0.0). `key_status`, where present, is also an **input**: §6.2's online revocation answer, as the corpus declares a verifier is assumed to have fetched it. It has @@ -118,9 +120,11 @@ them from the committed 36 and 37 through `tools/src/remux.ts`, which rewrites sample tables only, and that is what keeps them auditable rather than asserted. Since the 5.0.0 corpus it also re-signs their core and segment chain with the test key, over the device's capture id and content hashes: the -device proofs predate `media.presentation`, a required core field, and read -*no proof found*, so an edit under them would test nothing else. 166–168 are -the device containers of 36, 48 and 85 under such a core, unedited. +device proofs predate `media.presentation` and `media.timing`, required core +fields, and read *no proof found*, so an edit under them would test nothing +else. Both fields, and each segment entry's `timing`, are read back from the +device's container. 166–168 are the device containers of 36, 48 and 85 under +such a core, unedited; 175–187 are the timing cases of 166 and of 89's cut. They are not all the same weight of evidence, and each `NOTES.md` says which it is. 36, 37, 47 and 85 carry a **real device signature**: an implementation that @@ -146,7 +150,7 @@ The numbered corpus (`vectors/NN-*`) has its own version, in `vectors/VERSION` — separate from `vcap/1.0`, the proof format version. The format version says what a proof looks like; the corpus version says which exact vectors an implementation checked itself against, so a third party can claim "conformant -with vcap-spec corpus 6.2.0" and mean something a consumer can check. +with vcap-spec corpus 7.0.0" and mean something a consumer can check. `vectors/MANIFEST.json` is that check: for every `vectors/NN-*` directory, its `kind`, its `outcome`, and a SHA-256 over its files (name and length included, @@ -162,7 +166,7 @@ npm run manifest:check # exits 1 if the committed file is stale — CI runs th ``` `vectors/CONFORMANCE.md` says what the sentence "conformant with corpus -6.2.0" has to contain to be checkable — corpus version, manifest hash, and +7.0.0" has to contain to be checkable — corpus version, manifest hash, and how many vectors actually ran — and why a suite that ran zero vectors must be red. `vectors/conformance-report.json` is this repository's own claim in that format, regenerated and checked by CI (`npm run conformance:report` / @@ -213,7 +217,15 @@ carry the proof of a source capture*. Nothing else moved. 6.1.0 is a minor again: 169–171 added (a sidecar is no longer overruled by a depth-0 manifest proof that does worse over the same bytes, §3.1 step 4), none changed. 6.2.0 is a minor too: 172–174 added (the same rule for a trailer, §3.1 *A sidecar -that does better*), none changed. +that does better*), none changed. **7.0.0 is major**: `media.timing` became a +required core field and `timing` a required member of every `segments[]` +entry (§5 *Timing*), and the audio `esds` joined `media.presentation.config`. +Every video vector a script can rebuild moved bytes under a core re-signed +with both — 33, 38, 39, 86–94, 156, 158–163, 165–168 and 173 by `npm run +generate`, 143–147 and 171 minted again by `make-c2pa-vectors.ts` (new +salts) — and **none changed its verdict**; 34 did not move (no `segments`). +The device captures 36, 37, 48 and 85 keep their bytes and their *no proof +found*. 175–187 were added. `vectors/edge-cases/` (below) is not in the manifest and not part of the versioned corpus: it is regenerated on demand by its own tool, not hand-curated @@ -320,7 +332,9 @@ carries the verdict in force. Secure Enclave signatures of 85 and the StrongBox ones of 36 and 37 are still the corpus's only real device signatures over video, now on the path to *no proof found*; 47, a photo, still verifies under its Secure Enclave - signature. + signature. From the 7.0.0 corpus their cores also lack `media.timing`, and + their entries `timing`: the verdict is unchanged, and the same four + re-signed vectors exercise the containers under a core that binds timing. - **85 · `85-mp4-container-ios-sealed`** — its note explains the five one-frame segments as VideoToolbox answering a forced keyframe with two IDRs. That is @@ -343,13 +357,17 @@ carries the verdict in force. depth 0), 147 **no proof found** (*Content Credentials carry the proof of a source capture*). Their notes record c2patool 0.27.16, which reports no informational codes on these files; the other C2PA vectors record 0.28.0. + The 7.0.0 corpus mints them again, with 143, 144 and 171, over vector + 166's core as re-signed to carry `media.timing`: new salts, same verdicts, + and the notes of 143 and 144 now record c2patool 0.27.16 too. - **158 · `158-mp4-presentation-original`** — its note says the sample entry has no `clap`, `pasp` or `colr` box. It has a `colr` (`nclx`), the one vector 37's `MediaMuxer` wrote, and the signed `config` covers it, as §5 *Presentation* requires: the verdict and `expected.json` are right, the parenthesis is not. Vectors 159–163 are built from the same file and carry - the same `colr`. + the same `colr`. The 7.0.0 corpus regenerated 158 and corrected the + parenthesis in place. ## Not here yet, and why @@ -373,7 +391,9 @@ corroboration of a `location` with no coordinates). *verified clip* over the whole received file. Vector 89 is the same cut made by this repository's own sample-table rewrite with the proof in the trailer; the case with another tool's output, whose `moov` and interleaving - are its own, still wants that tool's file. + are its own, still wants that tool's file — and, since 7.0.0, whether that + tool keeps every frame's timing exactly (§5 *Timing*; vector 182 is the + exact re-mux, 181 the one that is not). - **A C2PA manifest signed by a credential on the C2PA trust list**: the carrier vectors are *Trusted* only against the test root, and a trust-listed signer needs a legal entity (`spec/c2pa-interop-1.0.md`, *We do not sign*). diff --git a/vectors/VERSION b/vectors/VERSION index 6abaeb2..66ce77b 100644 --- a/vectors/VERSION +++ b/vectors/VERSION @@ -1 +1 @@ -6.2.0 +7.0.0 diff --git a/vectors/conformance-report.json b/vectors/conformance-report.json index ac0517f..e277c1f 100644 --- a/vectors/conformance-report.json +++ b/vectors/conformance-report.json @@ -1,26 +1,26 @@ { "implementation": "vcap-spec reference verifier (tools/src/verify.ts)", - "corpus_version": "6.2.0", - "manifest_sha256": "2ff5796392cf2b26d51700e55f409edcbd3aab4287105aaf11158a7b1f5b0e6d", - "vectors_declared": 174, - "vectors_run": 174, - "passed": 174, + "corpus_version": "7.0.0", + "manifest_sha256": "ac9109e533ec981081c68e7859bb59552f129269cdaf4e38e2a6acb6edabc2ec", + "vectors_declared": 187, + "vectors_run": 187, + "passed": 187, "failed": [], "by_kind": { - "container": 30, + "container": 43, "file": 135, "jcs": 2, "segments": 7 }, "by_expected_outcome": { - "authentic": 96, + "authentic": 98, "corrupted_proof": 3, - "frames_not_compared": 6, + "frames_not_compared": 12, "n/a": 2, "nested_proof": 1, - "no_proof_found": 31, - "tampered": 25, + "no_proof_found": 33, + "tampered": 26, "unsupported_format_version": 2, - "verified_clip": 8 + "verified_clip": 10 } }