RedoubtZero-core
RAII guards and systematic zeroization primitives for protecting sensitive data in memory.
RedoubtZero-core provides composable building blocks for secure memory handling:
- [
ZeroizeOnDropSentinel]: Runtime verification that zeroization happened before drop - [
ZeroizingMutGuard]: RAII guard for mutable references (auto-zeroizes on drop) - Traits: [
FastZeroizable], [ZeroizationProbe], [AssertZeroizeOnDrop], [MutGuarded] - Derive macro:
#[derive(RedoubtZero)]for automatic trait implementations
Design Principles
- Systematic zeroization: Guards auto-zeroize on drop (impossible to forget)
- Runtime verification: [
ZeroizeOnDropSentinel] ensures zeroization happened - API safety: High-level wrappers can prevent direct access to sensitive data
- Composability: Traits work with collections, nested types, custom structs
Quick Start
Using ZeroizingMutGuard
use ;
let mut sensitive: u64 = 12345;
// guard drops here → sensitive is zeroized
assert!;
Manual Implementation
use ;
let creds = Credentials ;
// Verify zeroization happens on drop
creds.assert_zeroize_on_drop; // ✅ Passes
Safety
This crate uses #![warn(unsafe_op_in_unsafe_fn)] and minimizes unsafe usage.
All guards rely on RAII (Drop trait) for safety guarantees.
License
GPL-3.0-only