Draft: draft-ietf-mls-protocol

Commentary: The recently introduced variable size encoding allows for very large message sizes that are not practical in any realistic scenario . Since decoders will most likely not allow such large messages anyway , this PR limits the maximum size to 30 - bit . 
 cc who had some thoughts about limits on the last virtual interim . 
 My general points are : Code defensively Fail gracefully Use the lower level protocol carrying MLS Messages to send a clear and relevant error message if something is too big . Ex : HTTP/2.0 413 Commit . Proposals exceeds 2 ^ 16 bytes ex : HTTP/2.0 413 Too many proposals referenced in Commit ( 9999 )
Paragraph (version A):
Such a vector can represent values with length from 0 bytes to 2^62
bytes.  The variable-length integer encoding reserves the two most
significant bits of the first byte to encode the base 2 logarithm of
the integer encoding length in bytes.  The integer value is encoded
on the remaining bits, in network byte order.  The encoded value MUST
use the smallest number of bits required to represent the value.
When decoding, values using more bits than necessary MUST be treated
as malformed.
Paragraph (version B):
Such a vector can represent values with length from 0 bytes to 2^30
bytes.  The variable-length integer encoding reserves the two most
significant bits of the first byte to encode the base 2 logarithm of
the integer encoding length in bytes.  The integer value is encoded
on the remaining bits, in network byte order.  The encoded value MUST
use the smallest number of bits required to represent the value.
When decoding, values using more bits than necessary MUST be treated
as malformed.
Paragraph (version A):
This means that integers are encoded on 1, 2, 4, or 8 bytes and can
encode 6-, 14-, 30-, or 62-bit values respectively.
Paragraph (version A):
For example, the eight-byte sequence c2 19 7c 5e ff 14 e8 8c (in
hexadecimal) decodes to the decimal value 151288809941952652; the
four byte sequence 9d 7f 3e 7d decodes to 494878333; the two byte
sequence 7b bd decodes to 15293; and the single byte 25 decodes to 37
(as does the two byte sequence 40 25).
Paragraph (version A):
The use of variable-size integers for vector lengths allows vectors
to grow very large, up to 2^62 bytes.  Implementations should take
care not to allow vectors to overflow available storage.  To
facilitate debugging of potential interoperatbility problems,
implementations should provide a clear error when such an overflow
condition occurs.
Paragraph (version B):
This means that integers are encoded on 1, 2, or 4 bytes and can
encode 6-, 14-, or 30-bit values respectively.
Paragraph (version B):
Vectors that start with "11" prefix are invalid and MUST be rejected.
Paragraph (version B):
For example, the four byte sequence 0x9d7f3e7d decodes to 494878333;
the two byte sequence 0x7bbd decodes to 15293; and the single byte
0x25 decodes to 37.
Paragraph (version B):
The use of variable-size integers for vector lengths allows vectors
to grow very large, up to 2^30 bytes.  Implementations should take
care not to allow vectors to overflow available storage.  To
facilitate debugging of potential interoperatbility problems,
implementations should provide a clear error when such an overflow
condition occurs.