mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-10 16:01:28 +01:00
Use operator syntax
eliminate a few redundant references
This commit is contained in:
committed by
Pratyush Mishra
parent
b42d5f8d36
commit
f1d8b122fc
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user