# MAX_AES_GCM_PLAINTEXT_SIZE

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

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

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, so decrypting holds the input, the output and Web Crypto's
internal copy at the same time, roughly 3x 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.