Skip to content

MAX_CHUNK_COUNT

const MAX_CHUNK_COUNT: 16777216 = 16777216

Defined in: packages/filecoin-encryption-envelope/src/constants.ts:46

Largest chunk count this library encodes or decodes: 2^24. The wire format can represent up to 2^32 - 1, which nothing here produces or accepts.

Each chunk is one AES-GCM message. RFC 9053 §4.1.1 sets an absolute limit of 2^32 messages per key and recommends roughly 2^24.5, following the TLS analysis; this rounds that down to the nearest power of two. A conservative message-count ceiling, not a FEE-specific forgery-probability calculation. Per CEK, which equals per invocation only because a fresh CEK is required for each whole-object encryption.