Skip to content

Virtual clients: More efficient PPRF - #2056

Merged
kkohbrok merged 11 commits into
mainfrom
konrad/vc_operation_ratchets
Jun 17, 2026
Merged

kkohbrok merged 11 commits into
mainfrom
konrad/vc_operation_ratchets

Conversation

@kkohbrok

@kkohbrok kkohbrok commented Jun 15, 2026 •

Copy link
Copy Markdown
Member

This PR switches virtual client operations from the 32byte PPRF to a more efficient SecretTree-style PR with one leaf per emulation group member plus on ratchet per operation type.

This PR should be reviewable commit-by-commit.

This PR defers to follow-up PRs:

  • KeyPackage creation and Welcome processing
  • GenerationId usage
  • VirtualClientAction via SafeAAD
  • Backwards-compat pass

Completely out of scope for now:

  • Onboarding new emulator clients via state transfer
  • Update proposals (in higher-level groups)
  • Private handshake messages

kkohbrok added 4 commits June 15, 2026 15:52
Extend the emulator-epoch derivation to the spec's epoch_id, epoch base
secret, epoch encryption key, generation id secret and reuse guard secret,
and carry them (plus emulation group size and ciphersuite) on the per-epoch
state. Replaces the EpochInfoTbe/PPRF-input derivation info with the
DerivationInfo / DerivationInfoTBE pair from the current draft.
Tree shaped like the emulation group's ratchet tree, rooted at the epoch
base secret, with one operation ratchet per VirtualClientOperationType per
leaf. Lazy node derivation, ratchet advance/skip/delete on the RFC 9420
secret-tree schedule, bounded retention of skipped generations, and the
OperationContext-bound operation secret. Unit tests for cross-instance
agreement, out-of-order consumption, retention bounds and serde.
Replace the vc_pprf storage entity with the operation secret tree, stored
separately from the static EmulationEpochState so per-operation ratchet
advances do not rewrite the static fields. Add the per-group emulation
bindings entity recording which emulation epoch was active at each recent
higher-level epoch. Memory and sqlite implementations plus a sqlite
migration and provider round-trip tests.
Allocate a leaf_node operation secret from the per-epoch tree at commit
build time and persist the advance immediately, derive the leaf encryption
keypair and path secret from it, and attach the encrypted DerivationInfo.
Receivers infer the operation type from leaf_node_source, re-derive the same
secret positionally, and recreate the path. Drop the PPRF operation
derivation and EpochInfoTbe; the PPRF module stays for the safe exporter
tree.
@kkohbrok
kkohbrok marked this pull request as ready for review June 15, 2026 16:40
@kkohbrok
kkohbrok requested a review from a team as a code owner June 15, 2026 16:40

@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, this is pretty comprehensive. Some nits and 2 logic questions.

Comment thread openmls/src/group/mls_group/mod.rs Resolved
Comment thread traits/src/storage.rs Resolved
@kkohbrok
kkohbrok requested a review from raphaelrobert June 17, 2026 09:31

@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 all the changes!

@kkohbrok
kkohbrok enabled auto-merge (squash) June 17, 2026 12:03
@kkohbrok
kkohbrok merged commit 484d5d3 into main Jun 17, 2026
40 checks passed
@kkohbrok
kkohbrok deleted the konrad/vc_operation_ratchets branch June 17, 2026 12:32
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