Skip to content
Snippets Groups Projects

refactor shard to use a simple vector

Merged STEVAN Antoine requested to merge refactor-shard into main
1 file
+ 6
9
Compare changes
  • Side-by-side
  • Inline
+ 6
9
@@ -40,13 +40,6 @@ impl<E: Pairing> Shard<E> {
return self.clone();
}
let elements = self
.bytes
.iter()
.zip(other.bytes.iter())
.map(|(es, eo)| es.mul(alpha).add(eo.mul(beta)))
.collect::<Vec<_>>();
let mut linear_combination = Vec::new();
linear_combination.resize(
max(
@@ -55,7 +48,6 @@ impl<E: Pairing> Shard<E> {
),
E::ScalarField::zero(),
);
for (i, l) in self.linear_combination.iter().enumerate() {
linear_combination[i] = linear_combination[i] + l.mul(alpha);
}
@@ -67,7 +59,12 @@ impl<E: Pairing> Shard<E> {
k: self.k,
linear_combination,
hash: self.hash.clone(),
bytes: elements,
bytes: self
.bytes
.iter()
.zip(other.bytes.iter())
.map(|(es, eo)| es.mul(alpha).add(eo.mul(beta)))
.collect::<Vec<_>>(),
size: self.size,
}
}
Loading