Repository navigation
fix(crypto): reject public Sapling encryption shared secrets - #7133
Closed
Federico2014 wants to merge 1 commit into
Closed
Federico2014 wants to merge 1 commit into
Federico2014 wants to merge 1 commit into
Conversation
This was referenced Nov 30, 2026
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.
What does this PR do?
Reject the canonical identity shared point in NoteEncryption.encryptToRecipient before key derivation or ciphertext creation. Both native shielded transactions and shielded TRC20 builders propagate this failure before output proving. The check covers identity aliases, small-order recipient points and a zero ephemeral secret.
Why are these changes required?
A degenerate recipient key can make the shared point public, exposing the amount and memo after the output is published. Check the canonical result of native key agreement rather than matching a particular recipient encoding. This sender-only change works with the existing SDK 1.0.0 and leaves historical note decryption and consensus verification unchanged.
This PR has been tested by:
Follow up
Companion Rust/SDK changes reject these inputs during output proof generation and add native regressions. The node guard can ship independently without a dependency update.
Extra details
Based on upstream release_v4.8.3 at b715a9f. No protocol, transaction-validation, SDK dependency, or historical-reading changes.
Companion PRs: tronprotocol/librustzcash#18 and tronprotocol/zksnark-java-sdk#25.