You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returning to the question raised in iqlusioninc/crates#757 - I am still not sure how to correctly do what I described there. Now that ZeroizeOnDrop exists, and a third-party SecretDataType implements it, how should I wrap SecretDataType in my type, which I also want to implement ZeroizeOnDrop? The way I currently do it
The second line is a static assertion in case the situation with SecretDataType changes. The problem is that this syntax may go away in the future (rust-lang/rust#48214). If I derive ZeroizeOnDrop for SecretKey, it'll be zeroized twice, which is not ideal. Should I write a Drop impl manually for SecretKey?
The text was updated successfully, but these errors were encountered:
All you need to do is derive(ZeroizeOnDrop). That's it.
It won't double-zeroize. Fields that impl ZeroizeOnDrop will be skipped by the owning container's derived Drop impl. Fields that impl Zeroize will be zeroized. If fields impl neither, it will cause a compile error.
It won't double-zeroize. Fields that impl ZeroizeOnDrop will be skipped by the owning container's derived Drop impl. Fields that impl Zeroize will be zeroized. If fields impl neither, it will cause a compile error.
Returning to the question raised in iqlusioninc/crates#757 - I am still not sure how to correctly do what I described there. Now that
ZeroizeOnDrop
exists, and a third-partySecretDataType
implements it, how should I wrapSecretDataType
in my type, which I also want to implementZeroizeOnDrop
? The way I currently do itThe second line is a static assertion in case the situation with
SecretDataType
changes. The problem is that this syntax may go away in the future (rust-lang/rust#48214). If I deriveZeroizeOnDrop
forSecretKey
, it'll be zeroized twice, which is not ideal. Should I write aDrop
impl manually forSecretKey
?The text was updated successfully, but these errors were encountered: