pub fn decompress_payload(
compression: u8,
data: &[u8],
uncompressed_len: u32,
) -> Result<Vec<u8>>Expand description
Decompress a sealed payload under the SPEC §1.1 bomb guard.
Rejects a declared length over MAX_DECOMPRESSED_BYTES BEFORE decoding, bounds the decoder
output to that cap DURING, and rejects on any length mismatch — a hostile peer cannot OOM the host.
§Errors
MessageError::DecompressionBomb if uncompressed_len exceeds the cap;
MessageError::UnsupportedCompression for an unknown id;
MessageError::DecompressedLengthMismatch on an overrun or a decoded-length disagreement;
MessageError::Codec on a zstd decoder failure.