Expand description
Binary framing primitives for the ZAR archive format.
Provides the ZAR wire format, validation primitives, and high-level archive
operations. Use operations for public create, add, remove, join,
encrypt/decrypt, check, info, list, grep, and extract APIs; the CLI is a
presentation layer over them.
Modules§
- operations
- High-level archive operations used by applications and the
zarcCLI. The CLI owns argument parsing and terminal UI; all archival logic is implemented here.
Structs§
- Archive
Path - Block
Frame - Block
Frame Metadata - Commit
Header - Commit-level metadata carried in the header frame. Replaces the old
CommitPrefix. The header frame is written at the end of each commit, so all sizes are known before encoding. - Commit
Validation Limits - Container
Header - Descriptor
Extension - Entry
Metadata - File
Entry - Header
Block Index Entry - A block’s location relative to the start of its commit’s data section.
- Header
Frame - Logical
Header - Logical
Header Limits - Password
KeyWrap - Recipient
KeyWrap - Toc
- Validated
Commit - Validated
Header
Enums§
- Archive
Path Error - Content
Aead - Device
Kind - Encryption
Descriptor - Encryption
Scope - File
Group Kind - Framing
Error - Hpke
Suite - Logical
Header Error - Metadata
Type - TocChange
- TocEntry
- TocError
Constants§
- AEAD_
NONCE_ SIZE - BLOCK_
FLAG_ ENCRYPTED - BLOCK_
FLAG_ NONCE_ PRESENT - BLOCK_
FLAG_ UNCOMPRESSED - Payload is stored as raw, uncompressed block data.
- COMMIT_
HEADER_ FIXED_ SIZE - Size of the fixed commit-header fields (magic through header_frame_size). magic[4] + framing_version[1] + flags[1] + commit_id[4] + data_section_size[8] + header_frame_size[4] = 22 bytes.
- COMMIT_
MAGIC - CONTAINER_
HEADER_ SIZE - Size of the container header: 4-byte magic + 8-byte first_header_offset.
- CONTAINER_
MAGIC - DEK_
SIZE - FRAMING_
VERSION - HEADER_
OFFSET_ SIZE - Size of the next_header_offset / this_header_offset fields (u64).
- MAX_
ENCRYPTION_ DESCRIPTOR_ SIZE - UNENCRYPTED_
DESCRIPTOR
Functions§
- decrypt_
content - Authenticates and decrypts one content payload.
- derive_
password_ key - Derives a wrapping key using Argon2id v1.3 and the supplied bounded parameters.
- encrypt_
content - Encrypts one independently-nonced compressed content payload.
- generate_
dek - Generates a cryptographically random 256-bit data-encryption key.
- generate_
nonce - Generates a cryptographically random nonce for content encryption.
- read_
container_ magic - unwrap_
dek_ with_ password - Recovers and authenticates a password-wrapped DEK.
- unwrap_
dek_ with_ password_ zeroizing - Recovers a password-wrapped DEK in a buffer that is zeroized on drop.
- wrap_
dek_ with_ password - Wraps a per-commit DEK with a password-derived key and fresh random salt/nonce.
- write_
container_ magic