Repository navigation
Virtual clients: More efficient PPRF - #2056
Merged
Merged
Conversation
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
marked this pull request as ready for review
June 15, 2026 16:40
raphaelrobert
requested changes
Jun 16, 2026
raphaelrobert
left a comment
Member
There was a problem hiding this comment.
Thanks, this is pretty comprehensive. Some nits and 2 logic questions.
raphaelrobert
approved these changes
Jun 17, 2026
raphaelrobert
left a comment
Member
There was a problem hiding this comment.
Thanks for making all the changes!
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 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:
GenerationIdusageVirtualClientActionvia SafeAADCompletely out of scope for now: