mlswg / mls-protocol Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move wire_format to a separate tagged-union structure MLSMessage
#523
Conversation
|
I think this problematic, because it implies that the wire format of an |
|
Thank you, now I understand better why I didn't think that I think it would be valuable to refactor the part of the document related to message framing to remove such ambiguities. The easiest way would be to be explicit about the conversion between I spent a lot of time thinking about the nicest way to handle these structures when I implemented these things in the F* implementation of MLS, and I think it could lead to a refactorization of this document. We can define the content of a message (so really, meta-data + the real content) like this: And the authentication of a message like this: If you have a You can then do the following conversions:
Then the rest of the document can then talk about I would understand if you want to do the minimal possible changes, however I think doing this kind of big refactor would make this document a lot easier to understand for a first-time reader. |
|
@TWal - That proposal actually seems like it could make the programming easier, in addition to making the text clearer. I would be game for a PR if you'd like to write one up. Going back to the original point about |
|
Okay, I'll start working on a PR that uses this decomposition! |
|
I'm not against attempting to refactor this. It has grown organically over time and could certainly benefit from a holistic overhaul. (@TWal not that you omitted the membership tag in your proposal above) |
|
I made a first draft on how the Message Framing section would look like after the refactor. If you agree about these changes I'll change the mentions to @raphaelrobert the membership tag is present only in the plaintext and not is the ciphertext, so is it is not part of |
|
I independently was working on a rewrite of the definition of MLSPlaintext as follows. Note that this makes the presence of the confirmation_tag and membership_tag more explicit. I am also not a fan of the name |
|
About About putting things into
About using |
|
If we're changing the name of |
|
@TWal have you made any more progress on this refactor? I am definitely still partial to using |
|
Discussion on working call:
|
|
I just made the merge post-section rearranging (it was an ugly one, it was easier to re-do it from scratch). @rohan-wire I opened the issue #574 to talk about it, since I feel it belong to a separate discussion. About adding |
|
Discussion on virtual interim:
|
Looks good to me, once the additional MLSMessageType values are in.
|
|
@TWal - Also happy to merge this and do the extra content types in a follow-up. Up to you. |
|
We still need to change the references to |
|
I just updated it, however I noticed something a bit weird when removing the mentions to Why do we make a hashref of the |
|
I think this goes in the right direction, but I'm wondering about the authentication of the
I'd like to propose the following changes:
|
|
Discussion on virtual interim:
|
|
I think this is now mergable, I introduced a new structure |
The current use of
wire_formatis a bit weird to me: it is the first value of bothMLSPlaintextandMLSCiphertextwhich allows the implementations to differentiate between them. Then it looks like it should be implemented as a regular tagged union, which is what this pull request does.This does not imply any changes to existing implementations.
One thing that this pull-request changes is that
MLSPlaintextis forced to havewire_format = mls_plaintext, but I don't see why it would have any other values in this case?