diff --git a/crypto/dleq/src/cross_group/mod.rs b/crypto/dleq/src/cross_group/mod.rs index c6e76b39..7d2501e2 100644 --- a/crypto/dleq/src/cross_group/mod.rs +++ b/crypto/dleq/src/cross_group/mod.rs @@ -232,7 +232,7 @@ where // Accumulate this bit these_bits |= bit << (i % bits_per_group); - bit = 0; + bit.zeroize(); if (i % bits_per_group) == (bits_per_group - 1) { let last = i == (capacity - 1); diff --git a/crypto/dleq/src/cross_group/scalar.rs b/crypto/dleq/src/cross_group/scalar.rs index 1cc2e5f9..5000c223 100644 --- a/crypto/dleq/src/cross_group/scalar.rs +++ b/crypto/dleq/src/cross_group/scalar.rs @@ -40,7 +40,7 @@ pub fn scalar_normalize( res1 += F0::from(bit.into()); res2 += F1::from(bit.into()); - bit = 0; + bit.zeroize(); } (res1, res2) diff --git a/crypto/frost/src/curve/mod.rs b/crypto/frost/src/curve/mod.rs index 2f0ba65a..0ba0ac6a 100644 --- a/crypto/frost/src/curve/mod.rs +++ b/crypto/frost/src/curve/mod.rs @@ -78,7 +78,7 @@ pub trait Curve: Clone + Copy + PartialEq + Eq + Debug + Zeroize { seed.extend(repr.as_ref()); for i in repr.as_mut() { - *i = 0; + i.zeroize(); } let res = Self::hash_to_F(b"nonce", &seed); @@ -112,7 +112,7 @@ pub trait Curve: Clone + Copy + PartialEq + Eq + Debug + Zeroize { let res = Option::::from(Self::F::from_repr(encoding)).ok_or(CurveError::InvalidScalar); for b in encoding.as_mut() { - *b = 0; + b.zeroize(); } res } diff --git a/crypto/multiexp/src/lib.rs b/crypto/multiexp/src/lib.rs index a58b6857..bdfa1107 100644 --- a/crypto/multiexp/src/lib.rs +++ b/crypto/multiexp/src/lib.rs @@ -36,7 +36,7 @@ where *raw_bit = false; groupings[p][i / w_usize] |= bit << (i % w_usize); - bit = 0; + bit.zeroize(); } }