Functions for securely wiping memory.
This module contains functions for securely and efficiently zeroizing memory. These operations won’t be optimized away be the compiler. They operate on raw memory regions and can invalidate the memory for types that do not have all zeros (binary) as a valid value. They should be used during deallocation, because the memory is unused and the memory needs not contain a value of a certain type than.
For good general purpose memory wiping use the
This zeroizer uses the volatile memset intrinsic which does not yet have a stable counterpart. It should be very fast, but requires nightly.
This zeroizer uses a volatile write per 8 bytes if the pointer is 8 byte
aligned, and otherwise uses
VolatileWriteZeroizer. This zeroization
technique is available for all target platforms on stable, but not very
This zeroizer uses a volatile write per byte. This zeroization technique is
similar to the
zeroize crate, available for all target platforms on
stable, but extremely slow.
This zeroizer uses inline asm with sse2 instructions if the pointer is 16
byte aligned, and otherwise uses
VolatileWrite8Zeroizer. This zeroization
technique is available for x86_64 platforms with sse2 cpu support on stable,
and reasonably fast for 16 byte aligned pointers.
Strategy for securely erasing memory.