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.
pub fn encrypt_outgoing_plaintext<R: RngCore>(
&mut self,
&self,
cv: &D::ValueCommitment,
cm: &D::NoteCommitment,
rng: &mut R,

View File

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

View File

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

View File

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