From befb178c61b802a2219e6e42f513d0aa2b3c2252 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 28 May 2021 23:14:48 +0100 Subject: [PATCH] zcash_note_encryption: Pass cmstar_bytes to Domain::derive_ock PRF^ock in the spec takes cm* as a byte array. Extracted from: https://github.com/zcash/librustzcash/commit/ae43e6c074dae82e9a2c8a578b57ef61091c9b1d --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7855349..eba324f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,7 +110,7 @@ pub trait Domain { fn derive_ock( ovk: &Self::OutgoingViewingKey, cv: &Self::ValueCommitment, - cmstar: &Self::ExtractedCommitment, + cmstar_bytes: &Self::ExtractedCommitmentBytes, ephemeral_key: &EphemeralKeyBytes, ) -> OutgoingCipherKey; @@ -291,7 +291,7 @@ impl NoteEncryption { rng: &mut R, ) -> [u8; OUT_CIPHERTEXT_SIZE] { let (ock, input) = if let Some(ovk) = &self.ovk { - let ock = D::derive_ock(ovk, &cv, &cmstar, &D::epk_bytes(&self.epk)); + let ock = D::derive_ock(ovk, &cv, &cmstar.into(), &D::epk_bytes(&self.epk)); let input = D::outgoing_plaintext_bytes(&self.note, &self.esk); (ock, input)