Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ed25519/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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];
}
}