Skip to content

Commit

Permalink
hybrid-array: Impl Zeroize for Array
Browse files Browse the repository at this point in the history
  • Loading branch information
rozbb committed Nov 18, 2023
1 parent df6d2f4 commit 7278c0f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions hybrid-array/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ rust-version = "1.65"

[dependencies]
typenum = "1.17"
zeroize = { version = "1.7", path = "../zeroize" }
11 changes: 11 additions & 0 deletions hybrid-array/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
use super::{Array, ArrayOps, ArraySize, IntoArray};
use zeroize::Zeroize;

impl<T, U> Zeroize for Array<T, U>
where
T: Zeroize,
U: ArraySize,
{
fn zeroize(&mut self) {
self.0.as_mut().iter_mut().zeroize()
}
}

macro_rules! impl_array_size {
($($len:expr => $ty:ident),+) => {
Expand Down

0 comments on commit 7278c0f

Please sign in to comment.