-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow Orchard ivk = 0 on IncomingViewingKey::from & SpendingKey generation #3962
Conversation
I'm marking this as "do not merge", until we work out how risky it is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I added some ideas, but they are optional.
All of our shielded key code beyond what is serialized/deserialized on chain/in P2P network messages is currently not being used beyond testing and conformance, until we use it for wallet functionality or whatever. That includes Orchard |
Definitely willing to hold as :do-not-merge: until we tag as it is low priority |
@Mergifyio update |
✅ Branch has been successfully updated |
@Mergifyio update |
✅ Branch has been successfully updated |
@mergify rebase |
❌ Base branch update has failedGit reported the following error:
err-code: E0F31 |
@dconnolly this PR hasn't changed in 2 months, can we consider turning it into a ticket as part of the Cryptography triage? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Co-authored-by: Janito Vaqueiro Ferreira Filho <[email protected]>
✅ Branch has been successfully updated |
Mergifyio update |
@Mergifyio update |
✅ Branch has been successfully updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-approving based on previous approvals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested ACK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs clippy::unwrap-in-result
fixes:
https://github.com/ZcashFoundation/zebra/runs/7086134368?check_suite_focus=true#step:7:543
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-untested ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these clippy fixes, sorry no-one reviewed this PR until now!
@Mergifyio update |
✅ Branch has been successfully updated |
Motivation
A change to the protocol spec for Orchard to reject scalar values in the Pallas scalar field of 0 for incoming viewing keys.
Specifications
https://zips.z.cash/protocol/protocol.pdf#orchardkeycomponents
Solution
Update
impl From<FullViewingKey> for IncomingViewingKey
to become aTryFrom
, and returnResult::Err
if we get ⊥ or the possiblepallas::Scalar
value is0
in the scalar field.Update
SpendingKey::new()
to also check that a prospectivesk
doesn't lead to an invalidIncomingViewingKey
.Also implement
TryFrom<[u8; 64]> for IncomingViewingKey
to enforce that parsing of the raw encoding checks for and rejects the same values.Closes #3869
Review
This is low priority because it is not an NU5 consensus rule, but an Orchard protocol check for keygen and ingesting of keys/addresses.
Reviewer Checklist
Follow Up Work