From 6e217b3c834463ed90dc2ac78f859f7abe31adf7 Mon Sep 17 00:00:00 2001 From: Dmitry Demin Date: Thu, 8 Aug 2024 12:39:01 +0200 Subject: [PATCH] Update ShieldedOutput to return reference for enc_ciphertext These changes were discussed and suggested in PR zcash_note_encryption#2 --- Cargo.lock | 2 +- Cargo.toml | 4 ++-- src/note_encryption/compact_action.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b6afc650..30a5608ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2552,7 +2552,7 @@ dependencies = [ [[package]] name = "zcash_note_encryption" version = "0.4.0" -source = "git+https://github.com/QED-it/zcash_note_encryption?branch=zsa1#58384553aab76b2ee6d6eb328cf2187fa824ec9a" +source = "git+https://github.com/QED-it/zcash_note_encryption?branch=return-ref-from-enc-ciphertext#3a54c7281bacf59fe8dcffc6d9b82db60ae465f6" dependencies = [ "chacha20", "chacha20poly1305", diff --git a/Cargo.toml b/Cargo.toml index 7b0389cdd..a0d7babb0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ reddsa = "0.5" nonempty = "0.7" serde = { version = "1.0", features = ["derive"] } subtle = "2.3" -zcash_note_encryption_zsa = { package = "zcash_note_encryption", version = "0.4", git = "https://github.com/QED-it/zcash_note_encryption", branch = "zsa1" } +zcash_note_encryption_zsa = { package = "zcash_note_encryption", version = "0.4", git = "https://github.com/QED-it/zcash_note_encryption", branch = "return-ref-from-enc-ciphertext" } incrementalmerkletree = "0.5" zcash_spec = "0.1" zip32 = "0.1" @@ -60,7 +60,7 @@ bridgetree = "0.4" criterion = "0.4" # 0.5 depends on clap 4 which has MSRV 1.70 halo2_gadgets = { git = "https://github.com/QED-it/halo2", rev = "7f5c0babd61f8ca46c9165a1adfac298d3fd3a11", features = ["test-dependencies"] } proptest = "1.0.0" -zcash_note_encryption_zsa = { package = "zcash_note_encryption", version = "0.4", git = "https://github.com/QED-it/zcash_note_encryption", branch = "zsa1", features = ["pre-zip-212"] } +zcash_note_encryption_zsa = { package = "zcash_note_encryption", version = "0.4", git = "https://github.com/QED-it/zcash_note_encryption", branch = "return-ref-from-enc-ciphertext", features = ["pre-zip-212"] } incrementalmerkletree = { version = "0.5", features = ["test-dependencies"] } ahash = "=0.8.6" #Pinned: 0.8.7 depends on Rust 1.72 diff --git a/src/note_encryption/compact_action.rs b/src/note_encryption/compact_action.rs index d7494d1c8..79227001a 100644 --- a/src/note_encryption/compact_action.rs +++ b/src/note_encryption/compact_action.rs @@ -20,8 +20,8 @@ impl ShieldedOutput> for Action Option { - Some(self.encrypted_note().enc_ciphertext) + fn enc_ciphertext(&self) -> Option<&D::NoteCiphertextBytes> { + Some(&self.encrypted_note().enc_ciphertext) } fn enc_ciphertext_compact(&self) -> D::CompactNoteCiphertextBytes { @@ -69,7 +69,7 @@ impl ShieldedOutput> for CompactAction< self.cmx.to_bytes() } - fn enc_ciphertext(&self) -> Option { + fn enc_ciphertext(&self) -> Option<&D::NoteCiphertextBytes> { None }