INNER CODE UNIT · Rust

zeroize

brndnmtthws/dryoc · src/argon2/mod.rs:77

    fn zeroize(&mut self) {
        // The derived implementation issues one volatile 8-byte store per
        // word. `zeroize_u64s` covers the same words with volatile stores of
        // the 16-byte aligned middle (`stp xzr, xzr` on AArch64) plus per-word
        // stores for any unaligned ends, which makes freeing the memory region
        // several times cheaper while every byte is still written by a
        // volatile store that the compiler cannot elide.
        crate::utils::zeroize_u64s(&mut self.v);
    }
}

impl Drop for Block {
    fn drop(&mut self) {
        self.zeroize();
    }
}

impl ZeroizeOnDrop for Block {}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…