Seal trailer
Every sealed region is encrypted in place and ends with a 32-byte trailer. The regions are a WAL block, a MANIFEST record body, a SEAM frame, a SEAM footer and a derived cache file. TRAILER_LEN is 32.
Layout
Section titled “Layout”Offsets are from the start of the trailer.
| Offset | Size | Type | Meaning |
|---|---|---|---|
| 0 | 16 | bytes | GCM tag |
| 16 | 4 | u32 LE | nonce[0..4] = epoch |
| 20 | 8 | u64 LE | nonce[4..12] = counter |
| 28 | 4 | u32 LE | data key id |
- tag16 B
- epoch4 B
- counter8 B
- key id4 B
Opening a region
Section titled “Opening a region”To open a region, a reader reads the key id and the nonce from the trailer, looks up the key in the keyring, and decrypts region[..len-32] with the tag.
What is authenticated
Section titled “What is authenticated”The whole plaintext of the region plus the AAD. The trailer’s nonce and key id are not in the AAD but are bound by the GCM tag: a wrong nonce or key fails authentication.