Borrowed zeroizing guard for `&mut [u8]`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 674
- Forks
- 170
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 10
Description
Zeroizing<T> requires the stored type T itself to implement Zeroize. [u8] does but &mut [u8] does not.
I have a large reusable validator buffer where I need per-validation cleanup. Current workaround is a small guard:
struct ZeroizeOnDrop<'a>(&'a mut [u8]);
impl Drop for ZeroizeOnDrop<'_> {
fn drop(&mut self) {
self.0.zeroize();
}
}
Would you be open to adding an official borrowed guard, e.g. ZeroizingRef<'a, T: Zeroize + ?Sized>(&'a mut T), for this use case?
I'm open to alternatives
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Zeroizing and Zeroize implementations, then compare their behavior with the proposed borrowed guard for &mut [u8]. Determine whether the API should add ZeroizingRef<'a, T: Zeroize + ?Sized> or an alternative. Done means the project has an agreed public API for borrowed cleanup, with the use case and drop behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100