GCM.validateDataLength

private void validateDataLength(ulong len) static

Validates a plaintext or ciphertext length against the GCM block bound.

The 32-bit counter field limits each message to 2^^32 - 2 block invocations (NIST SP 800-38D 5.2.1.1); the wrap of inc32 past 2^^32 - 1 after the final legal block is harmless because the keystream is no longer used.

Parameters

lenplaintext or ciphertext length in bytes

Throws

CryptoException if len exceeds (2^^32 - 2) * 16 bytes.