We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5abdc1 commit 442c32cCopy full SHA for 442c32c
poly1305/src/autodetect.rs
@@ -88,10 +88,10 @@ impl Clone for State {
88
impl Drop for State {
89
fn drop(&mut self) {
90
use zeroize::Zeroize;
91
- if self.token.get() {
92
- // TODO(tarcieri): SIMD zeroize support
93
- } else {
94
- unsafe { self.inner.soft.zeroize() }
95
- }
+ const SIZE: usize = core::mem::size_of::<State>();
+
+ let inner_array = unsafe { &mut *(self as *mut State as *mut [u8; SIZE]) };
+ inner_slice.zeroize();
96
}
97
0 commit comments