CCM.validateLengths

private void validateLengths(const(ubyte)[] message, const(ubyte)[] aad, const(ubyte)[] nonce) static

Validates that the message and AAD lengths are encodable for this nonce: the q = 15 - nonce.length length field must hold the message length, the block counter must not wrap past 2^(8q) blocks (which would repeat the S0 keystream - a two-time pad), and the AAD length must fit the 32-bit encoding of RFC 3610 A.2.