Use operator syntax

eliminate a few redundant references
This commit is contained in:
François Garillot
2019-12-02 07:34:37 -08:00
committed by Pratyush Mishra
parent b42d5f8d36
commit f1d8b122fc
5 changed files with 8 additions and 8 deletions

View File

@@ -134,10 +134,10 @@ impl<G: Group, W: PedersenWindow> FixedLengthCRH for BoweHopwoodPedersenCRH<G, W
.map(|(chunk_bits, generator)| {
let mut encoded = generator.clone();
if chunk_bits[0] {
encoded = encoded + &generator;
encoded = encoded + generator;
}
if chunk_bits[1] {
encoded = encoded + &generator.double();
encoded += &generator.double();
}
if chunk_bits[2] {
encoded = encoded.neg();

View File

@@ -106,7 +106,7 @@ impl<G: Group, W: PedersenWindow> FixedLengthCRH for PedersenCRH<G, W> {
let mut encoded = G::zero();
for (bit, base) in bits.iter().zip(generator_powers.iter()) {
if *bit {
encoded = encoded + base;
encoded += base;
}
}
encoded