Skip to content

Commit

Permalink
Use zcash_note_encryption_zsa alias for zcash_note_encryption crate t…
Browse files Browse the repository at this point in the history
…o avoid conflict in zebra
  • Loading branch information
dmidem committed Oct 9, 2023
1 parent 7937e5b commit fb8dc40
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down Expand Up @@ -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" }
2 changes: 1 addition & 1 deletion src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
2 changes: 1 addition & 1 deletion src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/note_encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
5 changes: 2 additions & 3 deletions src/note_encryption_v2v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -440,7 +440,6 @@ impl BatchDomain for OrchardDomain {
}
}


/// Implementation of in-band secret distribution for Orchard bundles.
pub type OrchardNoteEncryption = zcash_note_encryption::NoteEncryption<OrchardDomain>;

Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/note_encryption_v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -349,7 +349,7 @@ impl BatchDomain for OrchardDomainV3 {
}

/// Implementation of in-band secret distribution for Orchard bundles.
pub type OrchardNoteEncryption = zcash_note_encryption::NoteEncryption<OrchardDomainV3>;
pub type OrchardNoteEncryption = zcash_note_encryption_zsa::NoteEncryption<OrchardDomainV3>;

impl<T> ShieldedOutput<OrchardDomainV3> for Action<T> {
fn ephemeral_key(&self) -> EphemeralKeyBytes {
Expand Down

0 comments on commit fb8dc40

Please sign in to comment.