Reuse validated cryptographic facts during message and sigchain processing - #39
Draft
holmesworcester wants to merge 7 commits into
Draft
holmesworcester wants to merge 7 commits into
holmesworcester wants to merge 7 commits into
Conversation
This was referenced Sep 15, 2026
Import immutable keysets into a private Team-owned store and retain successful delivery bindings across replay. Select keys only through the current state, keeping cryptographic material separate from authorization. Replace the global keyset, lockbox-opening, and key-map caches while preserving standalone validation and caller-owned open results. Validate with 765 passing auth, CRDX, crypto, and shared tests (87 existing skips), production builds, scoped lint, and separate-sender forced-GC edition checks at 10 and 100 users. The test-inclusive auth typecheck has 37 existing diagnostics versus 39 at the baseline, with no new diagnostics. Assisted-by: Codex
Discard the Team-owned checked-key store when decryption or merge validation fails, preventing rejected graph prefixes from retaining speculative keys for the Team lifetime. Preserve reuse after successful merges. Add realistic repeated-rejection regressions for semantic and ciphertext failures, followed by acceptance and reuse of the valid prefix. Both regressions failed before the fix and pass afterward. Validation: 767 tests passed with 87 existing skips, auth production build and scoped lint passed, and the broad test-inclusive typecheck has the same 37 pre-existing diagnostics. Assisted-by: Codex
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.
Quiet revalidated the same lockbox key material for every message and repeated old graph cryptography when receiving a new sigchain edition. This change retains checked keys within each Team and reuses successful graph cryptographic facts for complete unchanged inputs. Ordinary message signatures and current action authorization are still checked.
Implementation
Checked-key records last for the owning Team's lifetime; they are not serialized. A failed merge discards the store so valid prefixes of rejected graphs cannot accumulate retained keys; successful merges keep their records. Existing Team APIs and wire formats are unchanged. Standalone lockbox opening returns caller-owned key material. See the checked-key design notes.
Validation
Graph traversal, hashing, filtering, and contextual replay remain proportional to history. Earlier integrated iPhone timings included a separate crypto adapter and are not performance measurements of this PR alone.
Integration
This PR changes auth only. Quiet needs a submodule pointer update to consume the latest commit; its channel index is separate. No native crypto implementation is included or required. The OpenSSL alternative is isolated in TryQuiet/quiet#3541, while native libsodium is being developed separately.
Part of TryQuiet/quiet#3536 and TryQuiet/quiet#3537; intended for TryQuiet/quiet#3539. Targets
release/10.0.0.