Skip to main content

secure_zero

Function secure_zero 

Source
pub fn secure_zero<T>(data: &mut T)
Expand description

Secure memory zeroization

Securely zeros a memory region to prevent sensitive data from remaining in memory after use. This function uses compiler barriers to prevent optimization that might skip the zeroing.

§Arguments

  • data - Memory region to zero

§Security

This function uses compiler barriers to ensure the zeroing operation is not optimized away by the compiler.