Remove spurious mut references.

This commit is contained in:
Kris Nuttycombe 2021-04-08 10:08:00 -06:00
parent 879eea863a
commit a560101bb2
4 changed files with 7 additions and 7 deletions

View File

@ -268,7 +268,7 @@ impl<D: Domain> NoteEncryption<D> {
/// Generates `outCiphertext` for this note. /// Generates `outCiphertext` for this note.
pub fn encrypt_outgoing_plaintext<R: RngCore>( pub fn encrypt_outgoing_plaintext<R: RngCore>(
&mut self, &self,
cv: &D::ValueCommitment, cv: &D::ValueCommitment,
cm: &D::NoteCommitment, cm: &D::NoteCommitment,
rng: &mut R, rng: &mut R,

View File

@ -5,7 +5,7 @@ use zcash_primitives::{
consensus::{NetworkUpgrade::Canopy, Parameters, TestNetwork, TEST_NETWORK}, consensus::{NetworkUpgrade::Canopy, Parameters, TestNetwork, TEST_NETWORK},
memo::MemoBytes, memo::MemoBytes,
sapling::{ sapling::{
note_encryption::{sapling_note_encryption, try_sapling_note_decryption, Memo}, note_encryption::{sapling_note_encryption, try_sapling_note_decryption},
util::generate_random_rseed, util::generate_random_rseed,
Diversifier, PaymentAddress, SaplingIvk, ValueCommitment, Diversifier, PaymentAddress, SaplingIvk, ValueCommitment,
}, },
@ -38,7 +38,7 @@ fn bench_note_decryption(c: &mut Criterion) {
let note = pa.create_note(value, rseed).unwrap(); let note = pa.create_note(value, rseed).unwrap();
let cmu = note.cmu(); let cmu = note.cmu();
let mut ne = let ne =
sapling_note_encryption::<_, TestNetwork>(None, note, pa, MemoBytes::empty(), &mut rng); sapling_note_encryption::<_, TestNetwork>(None, note, pa, MemoBytes::empty(), &mut rng);
let ephemeral_key = *ne.epk(); let ephemeral_key = *ne.epk();
let enc_ciphertext = ne.encrypt_note_plaintext(); let enc_ciphertext = ne.encrypt_note_plaintext();

View File

@ -554,7 +554,7 @@ mod tests {
let cmu = note.cmu(); let cmu = note.cmu();
let ovk = OutgoingViewingKey([0; 32]); let ovk = OutgoingViewingKey([0; 32]);
let mut ne = sapling_note_encryption::<_, TestNetwork>( let ne = sapling_note_encryption::<_, TestNetwork>(
Some(ovk), Some(ovk),
note, note,
pa, pa,
@ -1591,7 +1591,7 @@ mod tests {
// Test encryption // Test encryption
// //
let mut ne = NoteEncryption::<SaplingDomain<TestNetwork>>::new_with_esk( let ne = NoteEncryption::<SaplingDomain<TestNetwork>>::new_with_esk(
esk, esk,
Some(ovk), Some(ovk),
note, note,
@ -1599,7 +1599,7 @@ mod tests {
MemoBytes::from_bytes(&tv.memo).unwrap(), MemoBytes::from_bytes(&tv.memo).unwrap(),
); );
assert_eq!(&ne.encrypt_note_plaintext().as_ref()[..], &tv.c_enc[..]); assert_eq!(ne.encrypt_note_plaintext().as_ref(), &tv.c_enc[..]);
assert_eq!( assert_eq!(
&ne.encrypt_outgoing_plaintext(&cv, &cmu, &mut OsRng)[..], &ne.encrypt_outgoing_plaintext(&cv, &cmu, &mut OsRng)[..],
&tv.c_out[..] &tv.c_out[..]

View File

@ -162,7 +162,7 @@ impl<P: consensus::Parameters> SaplingOutput<P> {
ctx: &mut Pr::SaplingProvingContext, ctx: &mut Pr::SaplingProvingContext,
rng: &mut R, rng: &mut R,
) -> OutputDescription { ) -> OutputDescription {
let mut encryptor = sapling_note_encryption::<R, P>( let encryptor = sapling_note_encryption::<R, P>(
self.ovk, self.ovk,
self.note.clone(), self.note.clone(),
self.to.clone(), self.to.clone(),