diff --git a/Cargo.toml b/Cargo.toml index 1ed0fb0f..69165bdf 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/benches/note_decryption.rs b/benches/note_decryption.rs index ce051cf0..ba0f6211 100644 --- a/benches/note_decryption.rs +++ b/benches/note_decryption.rs @@ -10,7 +10,7 @@ use orchard::{ Anchor, Bundle, }; use rand::rngs::OsRng; -use zcash_note_encryption::{batch, try_compact_note_decryption, try_note_decryption}; +use zcash_note_encryption_zsa::{batch, try_compact_note_decryption, try_note_decryption}; #[cfg(unix)] use pprof::criterion::{Output, PProfProfiler}; diff --git a/src/builder.rs b/src/builder.rs index fe385790..5e51162e 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -337,7 +337,7 @@ impl Builder { /// Adds a note to be spent in this transaction. /// /// - `note` is a spendable note, obtained by trial-decrypting an [`Action`] using the - /// [`zcash_note_encryption`] crate instantiated with [`OrchardDomain`]. + /// [`zcash_note_encryption_zsa`] crate instantiated with [`OrchardDomain`]. /// - `merkle_path` can be obtained using the [`incrementalmerkletree`] crate /// instantiated with [`MerkleHashOrchard`]. /// diff --git a/src/bundle.rs b/src/bundle.rs index a8e429a7..f3701175 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/issuance.rs b/src/issuance.rs index 29a95fda..8b5f200a 100644 --- a/src/issuance.rs +++ b/src/issuance.rs @@ -26,7 +26,7 @@ use crate::{ use crate::supply_info::{AssetSupply, SupplyInfo}; /// A bundle of actions to be applied to the ledger. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct IssueBundle { /// The issuer key for the note being created. ik: IssuanceValidatingKey, @@ -39,7 +39,7 @@ pub struct IssueBundle { /// An issue action applied to the global ledger. /// /// Externally, this creates new zsa notes (adding a commitment to the global ledger). -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct IssueAction { /// Asset description for verification. asset_desc: String, @@ -181,7 +181,7 @@ pub struct Prepared { } /// Marker for an authorized bundle. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Signed { signature: redpallas::Signature, } diff --git a/src/keys.rs b/src/keys.rs index 7853d492..4c6014f2 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 ca1b6601..6063f9c4 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, }; @@ -350,7 +350,7 @@ impl BatchDomain for OrchardDomainV2 { } /// 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 { @@ -450,7 +450,7 @@ impl CompactAction { mod tests { use proptest::proptest; use rand::rngs::OsRng; - use zcash_note_encryption::{ + use zcash_note_encryption_zsa::{ try_compact_note_decryption, try_note_decryption, try_output_recovery_with_ovk, Domain, EphemeralKeyBytes, }; diff --git a/src/note_encryption_v2v3.rs b/src/note_encryption_v2v3.rs index 5d3eedf2..107184ab 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,9 +440,8 @@ impl BatchDomain for OrchardDomain { } } - /// 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 { @@ -548,7 +547,7 @@ impl CompactAction { mod tests { use proptest::prelude::*; use rand::rngs::OsRng; - use zcash_note_encryption::{ + use zcash_note_encryption_zsa::{ try_compact_note_decryption, try_note_decryption, try_output_recovery_with_ovk, Domain, EphemeralKeyBytes, }; @@ -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 7594b588..ceff0cbe 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 { @@ -449,7 +449,7 @@ impl CompactAction { mod tests { use proptest::prelude::*; use rand::rngs::OsRng; - use zcash_note_encryption::{ + use zcash_note_encryption_zsa::{ try_compact_note_decryption, try_note_decryption, try_output_recovery_with_ovk, Domain, EphemeralKeyBytes, }; diff --git a/src/primitives/redpallas.rs b/src/primitives/redpallas.rs index 7690312a..f51b9e58 100644 --- a/src/primitives/redpallas.rs +++ b/src/primitives/redpallas.rs @@ -154,7 +154,7 @@ impl VerificationKey { } /// A RedPallas signature. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Signature(reddsa::Signature); impl From<[u8; 64]> for Signature { diff --git a/tests/builder.rs b/tests/builder.rs index 5d69209a..903ab3ec 100644 --- a/tests/builder.rs +++ b/tests/builder.rs @@ -12,7 +12,7 @@ use orchard::{ Anchor, Bundle, Note, }; use rand::rngs::OsRng; -use zcash_note_encryption::try_note_decryption; +use zcash_note_encryption_zsa::try_note_decryption; pub fn verify_bundle(bundle: &Bundle, vk: &VerifyingKey, verify_proof: bool) { if verify_proof { diff --git a/tests/zsa.rs b/tests/zsa.rs index d3dd1b92..5bf9063c 100644 --- a/tests/zsa.rs +++ b/tests/zsa.rs @@ -22,7 +22,7 @@ use orchard::{ }; use rand::rngs::OsRng; use std::collections::HashSet; -use zcash_note_encryption::try_note_decryption; +use zcash_note_encryption_zsa::try_note_decryption; #[derive(Debug)] struct Keychain {