Expose spend-auth signing and verification accessors - #193
Closed
schell wants to merge 1 commit into
Closed
Conversation
Add two public methods needed for non-transaction signatures (such as
UFVK binding signatures in zcash_keys):
- SpendAuthorizingKey::sign signs a message with the unrandomized key,
delegating to the inner redjubjub::SigningKey.
- SpendValidatingKey::to_verification_key returns the unrandomized
redjubjub::VerificationKey, enabling verification of non-spend signatures.
Also moves the rand_core::{CryptoRng, RngCore} import from a cfg(test) gate
to unconditional, since the new sign method needs it in production code.
Co-Authored-By: Claude <noreply@anthropic.com>
Author
|
Won't do. |
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.
Motivation
Downstream consumers (notably
zcash_keysin librustzcash) need to sign and verify non-transaction messages with spend-authorizing keys. For example, the proposed UFVK binding signature inzcash_keyssigns a UFVK's canonical encoding with the account'sUnifiedSpendingKeyto detect tampering of the stored UFVK in a wallet database (audit finding COR-1649).Currently, the signing and verification primitives are only accessible through the
randomizepath, which applies a per-spend randomizer. For non-transaction signatures, no randomizer is needed, but there is no public way to sign with the unrandomized key or to obtain the unrandomized verification key.Changes
SpendAuthorizingKey::signsigns a message with the unrandomized spend-authorizing key, delegating to the innerredjubjub::SigningKey.SpendValidatingKey::to_verification_keyreturns the unrandomizedredjubjub::VerificationKey, enabling verification of non-spend signatures.Both are pure delegation methods with no new logic. The existing
randomizepath is unchanged.COR-1649
Co-Authored-By: Claude noreply@anthropic.com