Closed
Description
Line 283 in 216d2b8
What is recommended approach to implement Zeroize
for non-copy-types? Consider some library has non-copy type:
// somelib.rs
#[derive(Clone)]
pub struct SecretKey([u8; 32]);
And in user code we have wrapper around that which we would like to zeroize on drop:
// main.rs
#[derive(Clone)]
struct MyKey(SecretKey);
One approach would be to implement Default
for MyKey
and add impl DefaultIsZeroes for MyKey {}
so MyKey
will implement Zeroize
, but it is not possible because of Copy
constraint on DefaultIsZeroes
Metadata
Metadata
Assignees
Labels
No labels