# MAX_AES_GCM_PLAINTEXT_SIZE

> `const` **MAX\_AES\_GCM\_PLAINTEXT\_SIZE**: `67108864` = `67108864`

Defined in: [packages/filecoin-encryption-envelope/src/constants.ts:70](https://github.com/FilOzone/synapse-sdk/blob/bc8a4b093324ccef9b407251fcf4e91823c6f599/packages/filecoin-encryption-envelope/src/constants.ts#L70)

Largest plaintext the one-shot AES-256-GCM scheme accepts.

Memory sets this number, not cryptography: NIST allows nearly 64 GiB per
GCM message. But scheme 1 cannot stream — one tag covers the whole
ciphertext. Encryption snapshots the input before its first asynchronous
step, Web Crypto allocates its result, and the envelope join allocates the
final object. Including caller-owned and internal buffers, peak memory may
approach 5x the plaintext. Runtime allocation ceilings differ and cannot
be queried, so this sits well under all of them. Larger objects use the
chunked scheme, which is flat in memory.

Raise it only with measurements, and never lower it: raising accepts
inputs older versions rejected, lowering breaks callers that work today.