Migrate to zcash_note_encryption 0.3.0

This commit is contained in:
Kris Nuttycombe 2023-03-09 15:30:43 -07:00
parent 6cbde279e9
commit dca33119b4
4 changed files with 6 additions and 9 deletions

View File

@ -23,6 +23,7 @@ and this project adheres to Rust's notion of
- `Error` has been renamed to `BuildError` to differentiate from new error - `Error` has been renamed to `BuildError` to differentiate from new error
types. types.
- `BuildError` now implements `std::error::Error` and `std::fmt::Display`. - `BuildError` now implements `std::error::Error` and `std::fmt::Display`.
- Migrate to `zcash_note_encryption 0.3.0`
## [0.3.0] - 2022-10-19 ## [0.3.0] - 2022-10-19
### Added ### Added

View File

@ -41,7 +41,7 @@ reddsa = "0.5"
nonempty = "0.7" nonempty = "0.7"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
subtle = "2.3" subtle = "2.3"
zcash_note_encryption = "0.2" zcash_note_encryption = "0.3"
incrementalmerkletree = "0.3" incrementalmerkletree = "0.3"
# Logging # Logging
@ -56,7 +56,7 @@ criterion = "0.3"
halo2_gadgets = { version = "0.2", features = ["test-dependencies"] } halo2_gadgets = { version = "0.2", features = ["test-dependencies"] }
hex = "0.4" hex = "0.4"
proptest = "1.0.0" proptest = "1.0.0"
zcash_note_encryption = { version = "0.2", features = ["pre-zip-212"] } zcash_note_encryption = { version = "0.3", features = ["pre-zip-212"] }
[target.'cfg(unix)'.dev-dependencies] [target.'cfg(unix)'.dev-dependencies]
inferno = ">= 0.11, < 0.11.15" inferno = ">= 0.11, < 0.11.15"
@ -92,3 +92,4 @@ debug = true
[patch.crates-io] [patch.crates-io]
halo2_gadgets = { git = "https://github.com/zcash/halo2.git", rev = "642924d614305d882cc122739c59144109f4bd3f" } halo2_gadgets = { git = "https://github.com/zcash/halo2.git", rev = "642924d614305d882cc122739c59144109f4bd3f" }
halo2_proofs = { git = "https://github.com/zcash/halo2.git", rev = "642924d614305d882cc122739c59144109f4bd3f" } halo2_proofs = { git = "https://github.com/zcash/halo2.git", rev = "642924d614305d882cc122739c59144109f4bd3f" }
zcash_note_encryption = { git = "https://github.com/zcash/librustzcash.git", rev = "169782c672abaa0c94940a3b2c2c6561933743c3" }

View File

@ -226,7 +226,6 @@ impl ActionInfo {
let encryptor = OrchardNoteEncryption::new( let encryptor = OrchardNoteEncryption::new(
self.output.ovk, self.output.ovk,
note, note,
self.output.recipient,
self.output.memo.unwrap_or_else(|| { self.output.memo.unwrap_or_else(|| {
let mut memo = [0; 512]; let mut memo = [0; 512];
memo[0] = 0xf6; memo[0] = 0xf6;

View File

@ -162,11 +162,7 @@ impl Domain for OrchardDomain {
secret.kdf_orchard(ephemeral_key) secret.kdf_orchard(ephemeral_key)
} }
fn note_plaintext_bytes( fn note_plaintext_bytes(note: &Self::Note, memo: &Self::Memo) -> NotePlaintextBytes {
note: &Self::Note,
_: &Self::Recipient,
memo: &Self::Memo,
) -> NotePlaintextBytes {
let mut np = [0; NOTE_PLAINTEXT_SIZE]; let mut np = [0; NOTE_PLAINTEXT_SIZE];
np[0] = 0x02; np[0] = 0x02;
np[1..12].copy_from_slice(note.recipient().diversifier().as_array()); np[1..12].copy_from_slice(note.recipient().diversifier().as_array());
@ -468,7 +464,7 @@ mod tests {
// Test encryption // Test encryption
// //
let ne = OrchardNoteEncryption::new_with_esk(esk, Some(ovk), note, recipient, tv.memo); let ne = OrchardNoteEncryption::new_with_esk(esk, Some(ovk), note, tv.memo);
assert_eq!(ne.encrypt_note_plaintext().as_ref(), &tv.c_enc[..]); assert_eq!(ne.encrypt_note_plaintext().as_ref(), &tv.c_enc[..]);
assert_eq!( assert_eq!(