-
Notifications
You must be signed in to change notification settings - Fork 0
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
adjust to zcash_note_encryption changes #2
Conversation
Cargo.toml
Outdated
@@ -102,3 +102,6 @@ harness = false | |||
[[bench]] | |||
name = "pedersen_hash" | |||
harness = false | |||
|
|||
[patch.crates-io] | |||
zcash_note_encryption = { version = "0.4", git = "https://github.com/QED-it/zcash_note_encryption", branch = "resolve_zcash_pr2_issues" } |
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.
Are we going to merge zcash_note_encryption first and use zsa1 here?
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.
yes
src/note_encryption.rs
Outdated
)) | ||
} | ||
|
||
fn parse_note_plaintext_bytes(plaintext: &[u8]) -> Option<Self::NotePlaintextBytes> { |
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.
I don't like the word "parse" here, but that's super minor concern
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.
The idea of having these functions with such names comes from str4d's review comment. Because our initial approach using the From
trait did not provide information about errors (and a possible TryFrom
replacement did not align with their approach of using Option
instead of Error
).
There's also an interesting question from @PaulLaux in the corresponding orchard
PR review: QED-it/orchard#111 (comment). Now, I am reconsidering whether we really need to implement these functions in bothorchard
and sapling-crypto
. We could implement them directly in the zcash_note_encryption
crate using the new from_slice
and from_slice_with_tag
methods of the NoteBytes
crate (I have described this approach in response to @PaulLaux's review in that orchard
PR).
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.
- remove both
FIXME
comments. - Let's merge
zcash_note_encryption
and change tozsa1
branch.
src/bundle.rs
Outdated
} | ||
|
||
fn enc_ciphertext_compact(&self) -> <SaplingDomain as Domain>::CompactNoteCiphertextBytes { | ||
todo!() |
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.
unimplemented!("This function is not required for sapling")
seems like a better option
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.
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.
some minor comments and same question for parse_note_..()
functions.
src/note_encryption.rs
Outdated
@@ -208,7 +214,8 @@ impl Domain for SaplingDomain { | |||
|
|||
input[COMPACT_NOTE_SIZE..NOTE_PLAINTEXT_SIZE].copy_from_slice(&memo[..]); | |||
|
|||
NotePlaintextBytes(input) | |||
// FIXME: avoid unwrap usage |
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.
remove comment
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.
Done.
src/note_encryption.rs
Outdated
} | ||
|
||
fn enc_ciphertext_compact(&self) -> <SaplingDomain as Domain>::CompactNoteCiphertextBytes { | ||
// FIXME: avoid unwrap usage |
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.
remove comment
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.
Done.
Replied about |
This PR synchronizes the
sapling-crypto
repository with the updates from PR #2 in thezcash_note_encryption
repository. The changes include:parse_note_plaintext_bytes
,parse_note_ciphertext_bytes
, andparse_compact_note_plaintext_bytes
methods of theDomain
trait fromzcash_note_encryption
.Domain
trait:NotePlaintextBytes
,NoteCiphertextBytes
,CompactNotePlaintextBytes
,CompactNoteCiphertextBytes
NoteBytes
trait andNoteBytesData
structure fromzcash_note_encryption
.Note
This PR uses the
resolve_zcash_pr2_issues
branch ofzcash_note_encryption
. Before merging this PR, PR #10 needs to be merged into thezsa1
branch ofzcash_note_encryption
. Additionally, thissapling-crypto
PR branch should be updated to use thezsa1
branch ofzcash_note_encryption
.