burdges / zerodrop-rs

Zero data when dropped in Rust
Other
2 stars 1 forks source link

Add ZeroDropCow #3

Closed burdges closed 7 years ago

burdges commented 7 years ago

It's maybe worth adding a ZeroDropCow<'a,T> type that represents either a &'a T or a Box<T> which zeros the Box<T> when dropped. Box is not used by std::borrow::Cow. Ain't clearly useful though since cryptographic material is rarely modified piecemeal.

burdges commented 7 years ago

I've added this now, not completely sure new_copy has the lifetimes right though.