Open ilaril opened 2 weeks ago
Ilari, I have no idea what you are trying to say. What do you mean "not parsable"? Can you please explain another way?
The domain separation is not guaranteed: Even if two inputs have different domains, the input to the KDF might still be the same.
While such thing seems to be very unlikely to happen and low impact in practice, cryptography is traditionally conservative and would rather eliminate the possibility altogether.
The KDF input
mlkemSS || tradSS || tradCT || tradPK || Domain
is not parsable, as a domain may be suffix of another. This means the inputs might collide even between what are supposed to be separate domains.The simplest way I can come up to make it parsable (and thus prevent inter-domain collisions) is to reverse the domain encoding:
mlkemSS || tradSS || tradCT || tradPK || reverse(Domain)
(Since it is possible to parse in reverse from the end.)