Skip to content

Commit

Permalink
Update ShieldedOutput to return reference for enc_ciphertext
Browse files Browse the repository at this point in the history
These changes were discussed and suggested in PR zcash_note_encryption#2
  • Loading branch information
Dmitry Demin committed Aug 8, 2024
1 parent 6e6112c commit 6e217b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/note_encryption/compact_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ impl<A, D: OrchardDomainCommon> ShieldedOutput<OrchardDomain<D>> for Action<A, D
self.cmx().to_bytes()
}

fn enc_ciphertext(&self) -> Option<D::NoteCiphertextBytes> {
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 {
Expand Down Expand Up @@ -69,7 +69,7 @@ impl<D: OrchardDomainCommon> ShieldedOutput<OrchardDomain<D>> for CompactAction<
self.cmx.to_bytes()
}

fn enc_ciphertext(&self) -> Option<D::NoteCiphertextBytes> {
fn enc_ciphertext(&self) -> Option<&D::NoteCiphertextBytes> {
None
}

Expand Down

0 comments on commit 6e217b3

Please sign in to comment.