From fb8dc402b7b6209de4a3f070849745af7ca337db Mon Sep 17 00:00:00 2001 From: Dmitry Demin Date: Mon, 9 Oct 2023 10:57:54 +0200 Subject: [PATCH] Use zcash_note_encryption_zsa alias for zcash_note_encryption crate to avoid conflict in zebra --- Cargo.toml | 7 ++----- src/bundle.rs | 2 +- src/keys.rs | 2 +- src/note_encryption.rs | 2 +- src/note_encryption_v2v3.rs | 5 ++--- src/note_encryption_v3.rs | 4 ++-- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1ed0fb0f7..69165bdfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ reddsa = "0.5" nonempty = "0.7" serde = { version = "1.0", features = ["derive"] } subtle = "2.3" -zcash_note_encryption = "0.4" +zcash_note_encryption_zsa = { package = "zcash_note_encryption", version = "0.4", git = "https://github.com/QED-it/librustzcash", branch = "zsa1-zebra" } incrementalmerkletree = "0.5" # Logging @@ -57,7 +57,7 @@ criterion = "0.4" # 0.5 depends on clap 4 which has MSRV 1.70 halo2_gadgets = { git = "https://github.com/QED-it/halo2", branch = "zsa1", features = ["test-dependencies"] } hex = "0.4" proptest = "1.0.0" -zcash_note_encryption = { version = "0.4", features = ["pre-zip-212"] } +zcash_note_encryption_zsa = { package = "zcash_note_encryption", version = "0.4", git = "https://github.com/QED-it/librustzcash", branch = "zsa1-zebra", features = ["pre-zip-212"] } incrementalmerkletree = { version = "0.5", features = ["test-dependencies"] } [target.'cfg(unix)'.dev-dependencies] @@ -91,6 +91,3 @@ debug = true [profile.bench] debug = true - -[patch.crates-io] -zcash_note_encryption = { version = "0.4", git = "https://github.com/QED-it/librustzcash.git", branch = "zsa1-zebra" } diff --git a/src/bundle.rs b/src/bundle.rs index a8e429a7c..f37011754 100644 --- a/src/bundle.rs +++ b/src/bundle.rs @@ -11,7 +11,7 @@ use core::fmt; use blake2b_simd::Hash as Blake2bHash; use memuse::DynamicUsage; use nonempty::NonEmpty; -use zcash_note_encryption::{try_note_decryption, try_output_recovery_with_ovk}; +use zcash_note_encryption_zsa::{try_note_decryption, try_output_recovery_with_ovk}; use crate::note::AssetBase; use crate::{ diff --git a/src/keys.rs b/src/keys.rs index 7853d4920..4c6014f20 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -14,7 +14,7 @@ use group::{ use pasta_curves::{pallas, pallas::Scalar}; use rand::{CryptoRng, RngCore}; use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}; -use zcash_note_encryption::EphemeralKeyBytes; +use zcash_note_encryption_zsa::EphemeralKeyBytes; use crate::{ address::Address, diff --git a/src/note_encryption.rs b/src/note_encryption.rs index ca1b66013..c324d865e 100644 --- a/src/note_encryption.rs +++ b/src/note_encryption.rs @@ -3,7 +3,7 @@ use blake2b_simd::{Hash, Params}; use group::ff::PrimeField; use std::fmt; -use zcash_note_encryption::{ +use zcash_note_encryption_zsa::{ BatchDomain, Domain, EphemeralKeyBytes, OutPlaintextBytes, OutgoingCipherKey, ShieldedOutput, AEAD_TAG_SIZE, MEMO_SIZE, OUT_PLAINTEXT_SIZE, }; diff --git a/src/note_encryption_v2v3.rs b/src/note_encryption_v2v3.rs index 5d3eedf25..2fa0fb68c 100644 --- a/src/note_encryption_v2v3.rs +++ b/src/note_encryption_v2v3.rs @@ -3,7 +3,7 @@ use blake2b_simd::{Hash, Params}; use core::fmt; use group::ff::PrimeField; -use zcash_note_encryption::{ +use zcash_note_encryption_zsa::{ BatchDomain, Domain, EphemeralKeyBytes, OutPlaintextBytes, OutgoingCipherKey, ShieldedOutput, AEAD_TAG_SIZE, MEMO_SIZE, OUT_PLAINTEXT_SIZE, }; @@ -440,7 +440,6 @@ impl BatchDomain for OrchardDomain { } } - /// Implementation of in-band secret distribution for Orchard bundles. pub type OrchardNoteEncryption = zcash_note_encryption::NoteEncryption; @@ -571,7 +570,7 @@ mod tests { Address, Note, }; - use super::{version, orchard_parse_note_plaintext_without_memo}; + use super::{orchard_parse_note_plaintext_without_memo, version}; proptest! { #[test] diff --git a/src/note_encryption_v3.rs b/src/note_encryption_v3.rs index 7594b588d..85010b1af 100644 --- a/src/note_encryption_v3.rs +++ b/src/note_encryption_v3.rs @@ -3,7 +3,7 @@ use blake2b_simd::{Hash, Params}; use core::fmt; use group::ff::PrimeField; -use zcash_note_encryption::{ +use zcash_note_encryption_zsa::{ BatchDomain, Domain, EphemeralKeyBytes, OutPlaintextBytes, OutgoingCipherKey, ShieldedOutput, AEAD_TAG_SIZE, MEMO_SIZE, OUT_PLAINTEXT_SIZE, }; @@ -349,7 +349,7 @@ impl BatchDomain for OrchardDomainV3 { } /// Implementation of in-band secret distribution for Orchard bundles. -pub type OrchardNoteEncryption = zcash_note_encryption::NoteEncryption; +pub type OrchardNoteEncryption = zcash_note_encryption_zsa::NoteEncryption; impl ShieldedOutput for Action { fn ephemeral_key(&self) -> EphemeralKeyBytes {