-
Notifications
You must be signed in to change notification settings - Fork 111
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
Use RedJubjub types in zebra-chain. #142
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ byteorder = "1.3" | |
chrono = "0.4" | ||
hex = "0.4" | ||
sha2 = "0.8" | ||
redjubjub = "0.1" | ||
|
||
[dev-dependencies] | ||
proptest = "0.9" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ pub mod proofs; | |
pub mod serialization; | ||
pub mod transaction; | ||
pub mod types; | ||
|
||
pub use redjubjub; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
// XXX this name seems too long? | ||
use crate::note_commitment_tree::SaplingNoteTreeRootHash; | ||
|
||
use crate::redjubjub::{self, Binding, SpendAuth}; | ||
|
||
/// A _Spend Description_, as described in [protocol specification §7.3][ps]. | ||
/// | ||
/// [ps]: https://zips.z.cash/protocol/protocol.pdf#spendencoding | ||
|
@@ -17,19 +19,14 @@ pub struct SpendDescription { | |
/// XXX refine to a specific type. | ||
pub nullifier: [u8; 32], | ||
/// The randomized public key for `spend_auth_sig`. | ||
/// | ||
/// XXX refine to a specific type. | ||
pub rk: [u8; 32], | ||
pub rk: redjubjub::PublicKeyBytes<SpendAuth>, | ||
/// The ZK spend proof. | ||
/// | ||
/// XXX add proof types. | ||
/// XXX for now it's [u64; 24] instead of [u8; 192] to get trait impls | ||
pub zkproof: [u64; 24], | ||
/// A signature authorizing this spend. | ||
/// | ||
/// XXX refine to a specific type: redjubjub signature? | ||
/// XXX for now it's [u64; 8] instead of [u8; 64] to get trait impls | ||
pub spend_auth_sig: [u64; 8], | ||
pub spend_auth_sig: redjubjub::Signature<SpendAuth>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ |
||
} | ||
|
||
/// A _Output Description_, as described in [protocol specification §7.4][ps]. | ||
|
@@ -47,7 +44,7 @@ pub struct OutputDescription { | |
pub cmu: [u8; 32], | ||
/// An encoding of an ephemeral Jubjub public key. | ||
/// | ||
/// XXX refine to a specific type. | ||
/// XXX refine to a Jubjub key agreement type, not RedJubjub. | ||
pub ephemeral_key: [u8; 32], | ||
/// A ciphertext component for the encrypted output note. | ||
/// | ||
|
@@ -74,7 +71,5 @@ pub struct ShieldedData { | |
/// A sequence of shielded outputs for this transaction. | ||
pub shielded_outputs: Vec<OutputDescription>, | ||
/// A signature on the transaction hash. | ||
// XXX refine this type to a RedJubjub signature. | ||
// for now it's [u64; 8] rather than [u8; 64] to get trait impls | ||
pub binding_sig: [u64; 8], | ||
pub binding_sig: redjubjub::Signature<Binding>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ |
||
} |
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.
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.
❤️