Expand description
Memory zeroization utilities for clearing sensitive cryptographic material.
This module implements zeroization in pure safe Rust. It uses core::hint::black_box and a
core::sync::atomic::compiler_fence (SeqCst) to keep the compiler from removing the
stores as dead. Safe Rust has no volatile write, so this is a best-effort barrier rather than
a language-level guarantee.
xtask asm-audit checks that the release codegen of each zeroize_* routine stores zeros to
memory. What that check covers and what it does not (inlined call sites) is tracked in
SECURITY.md.
Traits§
- Zeroize
- Trait for types whose sensitive contents can be overwritten with zeros.
Functions§
- zeroize_
bytes - Zeroes a mutable byte slice while inhibiting dead-store elimination.
- zeroize_
i16s - Zeroes a mutable
i16slice (such as signed lattice polynomial coefficients). - zeroize_
i32s - Zeroes a mutable
i32slice (such as signed ML-DSA polynomial coefficients). - zeroize_
u16s - Zeroes a mutable
u16slice (such as ML-KEM secret polynomial coefficients). - zeroize_
u32s - Zeroes a mutable
u32slice (such as ML-DSA secret polynomial coefficients). - zeroize_
u64s - Zeroes a mutable
u64slice (such asKeccak-f[1600]sponge state).