Skip to content

Commit

Permalink
use zeroizing
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Sep 28, 2023
1 parent 59a1957 commit a0bd689
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ristretto/pedersen/extended_commitment_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use curve25519_dalek::{
scalar::Scalar,
traits::{Identity, MultiscalarMul},
};
use zeroize::Zeroize;
use zeroize::Zeroizing;

#[cfg(feature = "precomputed_tables")]
use crate::ristretto::pedersen::scalar_mul_with_pre_computation_tables;
Expand Down Expand Up @@ -165,9 +165,8 @@ impl ExtendedHomomorphicCommitmentFactory for ExtendedPedersenCommitmentFactory
k_vec: &[RistrettoSecretKey],
v: &RistrettoSecretKey,
) -> Result<PedersenCommitment, CommitmentError> {
let mut blinding_factors: Vec<Scalar> = k_vec.iter().map(|k| k.0).collect();
let blinding_factors: Zeroizing<Vec<Scalar>> = Zeroizing::new(k_vec.iter().map(|k| k.0).collect());
let c = self.commit_scalars(&v.0, &blinding_factors)?;
blinding_factors.zeroize();
Ok(HomomorphicCommitment(RistrettoPublicKey::new_from_pk(c)))
}

Expand Down

0 comments on commit a0bd689

Please sign in to comment.