Skip to main content

Module format

Module format 

Source
Expand description

On-disk framing: fixed header, section table, trailer, canonical CBOR helpers.

+----------------------------------------------------------------+
| header (32 B): "TSR\x1A" | version u16 | flags u16 | hlen u32 | 0 |
| sections ... (recipients, dictionary, blobs, chunk index,       |
|               manifest, signatures)                             |
| section table (CBOR array of {t, off, len, h})                  |
| trailer (24 B): table_off u64 | table_len u64 | crc32 u32 | "RST\x1A" |
+----------------------------------------------------------------+

Every section is hashed (BLAKE3) in the table; the table itself is protected by the CRC in the trailer and, when present, by the signature section. There is exactly one source of truth for every value: readers refuse archives whose redundant fields disagree.

Modules§

section
Section type identifiers.

Structs§

Header
SectionEntry
SignatureBlock

Constants§

FLAG_ENCRYPTED
FLAG_SIGNED
HEADER_LEN
MAGIC
TRAILER_LEN
TRAILER_MAGIC
VERSION

Functions§

cbor_decode
cbor_encode
crc32
decode_header
decode_trailer
Returns (table_off, table_len, crc32).
encode_header
encode_trailer
signing_message
The message covered by the archive signature: header bytes and every non-signature section (type, offset, length, hash), domain separated.