Skip to main content

Module container

Module container 

Source
Expand description

The container: 32-byte file header, 32-byte chunk descriptors, the directory at the end of the file, and the 8-byte trailer ([spec/02-file-structure.md]).

Structs§

ChunkDescriptor
One 32-byte chunk directory entry.
ChunkType
A four-byte chunk type tag.
Directory
The chunk directory: one descriptor per chunk, in file order.
FileHeader
The fixed 32-byte file header at offset 0.

Constants§

CHUNK_DESCRIPTOR_SIZE
Size of one chunk descriptor.
CHUNK_FLAG_ENCRYPTED
Chunk descriptor bit 4: this payload is sealed.
FILE_HEADER_RESERVED_MASK
Bits a conforming v1 writer must leave clear: 0, 2, 4 and 5-31.
FILE_HEADER_SIZE
Size of the fixed file header at offset 0.
FLAG_ENCRYPTED
header.flags bit 3: an AUTH chunk is present and content chunks are sealed.
FLAG_MULTI_SECTOR
header.flags bit 1: the file uses sector-based layer encoding.
MAGIC
File magic, LUMN.
TRAILER_MAGIC
Trailer magic, LEND.
TRAILER_SIZE
Size of the directory trailer.

Functions§

crc32c
CRC-32C (Castagnoli) as the container and the LTBL/trailer use it.
first_chunk_type
The chunk type of the first chunk, or None if the directory is all null.
parse_directory
Parse the chunk directory.
parse_trailer
Read and verify the directory trailer, returning its CRC-32C.
verify_trailer_crc
Verify the trailer CRC-32C covers every preceding byte.