MAX_AES_GCM_PLAINTEXT_SIZE
constMAX_AES_GCM_PLAINTEXT_SIZE:67108864=67108864
Defined in: packages/filecoin-encryption-envelope/src/constants.ts:70
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.