Skip to content

Commit

Permalink
fix: remove 2 unnecessary allocations in batch_mul (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi authored Nov 22, 2022
1 parent 6797e7f commit ea33445
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ristretto/ristretto_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ impl PublicKey for RistrettoPublicKey {
}

fn batch_mul(scalars: &[Self::K], points: &[Self]) -> Self {
let p: Vec<&RistrettoPoint> = points.iter().map(|p| &p.point).collect();
let s: Vec<&Scalar> = scalars.iter().map(|k| &k.0).collect();
let p = points.iter().map(|p| &p.point);
let s = scalars.iter().map(|k| &k.0);
let p = RistrettoPoint::multiscalar_mul(s, p);
RistrettoPublicKey::new_from_pk(p)
}
Expand Down

0 comments on commit ea33445

Please sign in to comment.