tc_zeroize 0.1.0

Explicit memory erasure with volatile writes and opt-in scope guards.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Element-wise erasure of slices with public lengths.

use crate::Zeroize;
use core::sync::atomic::{Ordering, compiler_fence};

impl<T: Zeroize> Zeroize for [T] {
    fn zeroize(&mut self) {
        for value in self {
            value.zeroize();
        }
        compiler_fence(Ordering::SeqCst);
    }
}