mirror of
https://github.com/RustCrypto/signatures
synced 2026-06-21 13:45:42 +00:00
ed25519: impl Zeroize for ed25519::Signature (#952)
This commit is contained in:
@@ -292,6 +292,9 @@ use pkcs8::spki::{
|
||||
der::{self, asn1::BitString},
|
||||
};
|
||||
|
||||
#[cfg(feature = "zeroize")]
|
||||
use zeroize::Zeroize;
|
||||
|
||||
/// Size of a single component of an Ed25519 signature.
|
||||
const COMPONENT_SIZE: usize = 32;
|
||||
|
||||
@@ -446,3 +449,11 @@ impl fmt::Display for Signature {
|
||||
write!(f, "{:X}", self)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "zeroize")]
|
||||
impl Zeroize for Signature {
|
||||
fn zeroize(&mut self) {
|
||||
self.R = [0; 32];
|
||||
self.s = [0; 32];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user