Skip to content

Virtual clients: Compute reuse guard instead of generating randomly - #2030

Merged
kkohbrok merged 46 commits into
mainfrom
konrad/reuse_guard
Jun 15, 2026
Merged

kkohbrok merged 46 commits into
mainfrom
konrad/reuse_guard

Conversation

@kkohbrok

Copy link
Copy Markdown
Member

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.

Base automatically changed from konrad/process_own_commits to main May 29, 2026 18:49
@kkohbrok
kkohbrok marked this pull request as ready for review June 11, 2026 06:34
@kkohbrok
kkohbrok requested a review from a team as a code owner June 11, 2026 06:34

@raphaelrobert raphaelrobert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread openmls/src/framing/private_message.rs Resolved
Comment thread openmls/src/group/mls_group/mod.rs Resolved
Comment thread openmls/src/group/mls_group/mod.rs Resolved
Comment thread openmls/src/framing/validation.rs Resolved
Comment thread openmls/src/framing/validation.rs Resolved
@kkohbrok
kkohbrok requested a review from raphaelrobert June 12, 2026 13:07

@raphaelrobert raphaelrobert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes, let's get this in

@kkohbrok
kkohbrok enabled auto-merge (squash) June 13, 2026 08:51
@kkohbrok
kkohbrok merged commit 3322fa3 into main Jun 15, 2026
39 of 40 checks passed
@kkohbrok
kkohbrok deleted the konrad/reuse_guard branch June 15, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants