However, the document does not specify anywhere how to serialize a CleartextCredentials structure to bytes. As opposed to every other structure in the document, which has fixed field lengths (and can simply be serialized by concatenating the fields), CleartextCredentials has two fields with dynamic lengths. It is not immediately obvious how it should be serialized.
I was able to make an educated guess (based on the length constraint) that CleartextCredentials should be serialized as:
CleartextCredentials is specified as:
An instance of
CleartextCredentials
is then concatenated with the envelope nonce to generate theauth_tag
:However, the document does not specify anywhere how to serialize a
CleartextCredentials
structure to bytes. As opposed to every other structure in the document, which has fixed field lengths (and can simply be serialized by concatenating the fields),CleartextCredentials
has two fields with dynamic lengths. It is not immediately obvious how it should be serialized.I was able to make an educated guess (based on the length constraint) that
CleartextCredentials
should be serialized as:Which also then matches the provided test vectors. Nevertheless, this should be specified in the document.