Borrowed zeroizing guard for `&mut [u8]`
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- cryptography, security
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.
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
- Dominant language
- Rust
- Stars
- 674
- Forks
- 170
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 10
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
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.
More from RustCrypto/utils
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
RustCrypto/utils#1546 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
RustCrypto/utils#1537 · 7 comments ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
RustCrypto/utils#1534 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
RustCrypto/utils#1529 · 4 comments ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
RustCrypto/utils#1510 · 1 comment ·
Maintainers usually reply within 2 days
All issues in RustCrypto/utils
Similar issues
-
area:casework bug criticality:p3 triage:needs-implementation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
registrystack/registry-stack#1623 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DioxusLabs/anyrender#98 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
leptos-rs/leptos#4885 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
longbridge/gpui-kit#3276 ·
Maintainers usually reply within 1 day