ed25519: impl Zeroize for ed25519::Signature (#952)

This commit is contained in:
daxpedda
2025-04-29 21:51:43 +02:00
committed by GitHub
parent 32aea438cd
commit 57588e2ae7
+11
View File
@@ -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];
}
}