MCPcopy Create free account
hub / github.com/RustCrypto/utils / zeroize_bytes

Function zeroize_bytes

zeroize/src/lib.rs:728–731  ·  view source on GitHub ↗
(bytes: &mut [u8])

Source from the content-addressed store, hash-verified

726/// ```
727#[inline]
728pub fn zeroize_bytes(bytes: &mut [u8]) {
729 // SAFETY: the slice provides exclusive access to its bytes, and zero is a valid u8.
730 unsafe { zeroize_byte_ptr(bytes.as_mut_ptr(), bytes.len()) }
731}
732
733/// Zeroizes a flat type/struct. Only zeroizes the values that it owns, and it does not work on
734/// dynamically sized values or trait objects. It would be inefficient to use this function on a

Callers 1

bench_slicesFunction · 0.50

Calls 2

zeroize_byte_ptrFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected