# MAX_CHUNK_COUNT

> `const` **MAX\_CHUNK\_COUNT**: `16777216` = `16777216`

Defined in: [packages/filecoin-encryption-envelope/src/constants.ts:46](https://github.com/FilOzone/synapse-sdk/blob/9ad84d812e1dd635b76420a7d9388555a04f31b6/packages/filecoin-encryption-envelope/src/constants.ts#L46)

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.