mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Fix zeroization timeline in multiexp, cargo machete
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "multiexp"
|
||||
version = "0.4.1"
|
||||
version = "0.4.2"
|
||||
description = "Multiexponentiation algorithms for ff/group"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/serai-dex/serai/tree/develop/crypto/multiexp"
|
||||
|
||||
@@ -25,13 +25,14 @@ pub(crate) fn pippenger<G: Zeroize + Group<Scalar: PrimeFieldBits>>(
|
||||
for p in 0 .. bits.len() {
|
||||
buckets[usize::from(bits[p][n])] += pairs[p].1;
|
||||
}
|
||||
buckets.zeroize();
|
||||
|
||||
let mut intermediate_sum = G::identity();
|
||||
for b in (1 .. buckets.len()).rev() {
|
||||
intermediate_sum += buckets[b];
|
||||
res += intermediate_sum;
|
||||
}
|
||||
|
||||
buckets.zeroize();
|
||||
}
|
||||
|
||||
bits.zeroize();
|
||||
|
||||
Reference in New Issue
Block a user