implemented Zeroize for CompressedRistretto and RistrettoPoint

This commit is contained in:
gedigi 2020-03-19 14:16:06 -07:00
parent 805cdbfd3c
commit c9fe6c5533

View file

@ -200,6 +200,8 @@ use backend::serial::scalar_mul;
))]
use backend::vector::scalar_mul;
use zeroize::Zeroize;
// ------------------------------------------------------------------------
// Compressed points
// ------------------------------------------------------------------------
@ -1078,6 +1080,25 @@ impl Debug for RistrettoPoint {
}
}
// ------------------------------------------------------------------------
// Zeroize traits
// ------------------------------------------------------------------------
impl Zeroize for CompressedRistretto {
fn zeroize(&mut self) {
self.0.zeroize();
}
}
impl Zeroize for RistrettoPoint {
fn zeroize(&mut self) {
self.0.X.zeroize();
self.0.Y.zeroize();
self.0.Z.zeroize();
self.0.T.zeroize();
}
}
// ------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------