File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,12 @@ pub struct KeyPair([c_uchar; 96]);
224224impl_array_newtype ! ( KeyPair , c_uchar, 96 ) ;
225225impl_raw_debug ! ( KeyPair ) ;
226226
227+ impl Drop for KeyPair {
228+ fn drop ( & mut self ) {
229+ self . 0 . copy_from_slice ( & [ 0u8 ; 96 ] ) ;
230+ }
231+ }
232+
227233impl KeyPair {
228234 /// Creates an "uninitialized" FFI keypair which is zeroed out
229235 ///
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ pub struct SecretKey(pub(crate) [u8; constants::SECRET_KEY_SIZE]);
3232impl_ptr_newtype ! ( SecretKey , u8 ) ;
3333impl_safe_debug ! ( SecretKey ) ;
3434
35+ impl Drop for SecretKey {
36+ fn drop ( & mut self ) {
37+ self . 0 . copy_from_slice ( & [ 0u8 ; constants:: SECRET_KEY_SIZE ] ) ;
38+ }
39+ }
40+
3541impl str:: FromStr for SecretKey {
3642 type Err = Error ;
3743 fn from_str ( s : & str ) -> Result < SecretKey , Error > {
You can’t perform that action at this time.
0 commit comments