Skip to main content

Module compression

Module compression 

Source
Expand description

The compression layer (SPEC §1.1) — the crypto-free codec that runs BEFORE the seal (WU2). A payload is compressed in its OWN fresh context (never a shared running context — the §5.5 CRIME/ BREACH boundary), then WU2 seals the compressed bytes.

Two codecs ship in WU1: raw/identity (id 0, mandatory) and zstd level-3 (id 1, recommended). The reserved id bands (2..=63 standard, 64..=255 experimental) are rejected cleanly, never mis-decoded.

Structs§

CompressedPayload
A compressed payload ready to be sealed: the algorithm id, the compressed bytes, and the declared original length (the bomb-guard bound carried in the sealed InnerMessage, SPEC §5.2).

Constants§

COMPRESSION_NONE
Raw / identity codec: the payload bytes verbatim. Mandatory (SPEC §1.1).
COMPRESSION_ZSTD
zstd codec, pinned to level 3, single-frame, no dictionary (SPEC §1.1/§1.2).

Functions§

compress_payload
Compress a payload for sealing, choosing the codec per the SPEC §1.1 raw threshold.
decompress_payload
Decompress a sealed payload under the SPEC §1.1 bomb guard.