Repository navigation
Virtual clients: Compute reuse guard instead of generating randomly - #2030
Merged
Merged
Conversation
# Conflicts: # openmls/src/group/mls_group/errors.rs
kkohbrok
marked this pull request as ready for review
June 11, 2026 06:34
raphaelrobert
requested changes
Jun 11, 2026
raphaelrobert
left a comment
Member
There was a problem hiding this comment.
I did a first pass. I wonder if FF1 shouldn't go to the crypto provider instead. It can still be guarded by the feature flag.
I think it would also be good to add more tests, e.g. for collisions: two distinct leaf indices, same secret and nonce, should return distinct guards.
raphaelrobert
approved these changes
Jun 12, 2026
raphaelrobert
left a comment
Member
There was a problem hiding this comment.
Thanks for making the changes, let's get this in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the reuse guard computation/derivation aspect of the virtual clients draft.
When sending a PrivateMessage, clients compute the reuse guard based on the emulation group state that was last used to update the group. This binding between higher-level group (ID) and emulation group epoch is stored in the storage provider.
The reuse guard is computed using a small-space PRP, which is pulled in as a dependency.
On the spec-level, computing the reuse guard in this way avoids reuse guard collisions between emulator clients.
Emulator clients that receive a PrivateMessage from a sibling emulator client in a higher-level group can reverse the reuse guard computation to determine which emulator client has sent the message. This change, along with the failure modes associated with this reversing operation required some threading of information through various function calls. I apologize for the churn.