cml-crypto 6.2.0

Multiplatform SDK for Cardano-related cryptographic functionality
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
/// zero the given slice.
///
/// We assume the compiler won't optimise out the call to this function
pub fn _zero(to_zero: &mut [u8]) {
    // the unsafety of this call is bounded to the existence of the pointer
    // and the accuracy of the length of the array.
    //
    // since to_zero existence is bound to live at least as long as the call
    // of this function and that we use the length (in bytes) of the given
    // slice, this call is safe.
    unsafe { ::std::ptr::write_bytes(to_zero.as_mut_ptr(), 0, to_zero.len()) }
}