Skip to content

Commit

Permalink
ascon-aead: Add ascon sponge Zeroize feature (#527)
Browse files Browse the repository at this point in the history
Not zeroizing the state may expose the private key.
  • Loading branch information
aewag authored Oct 24, 2023
1 parent 9f3d08a commit 96fd7cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions ascon-aead/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rust-version = "1.56"
[dependencies]
aead = { version = "0.5", default-features = false }
subtle = { version = "2", default-features = false }
zeroize = { version = "1.6", optional = true, default-features = false, features = [
zeroize_crate = { package = "zeroize", version = "1.6", optional = true, default-features = false, features = [
"derive",
] }
ascon = "0.4"
Expand All @@ -27,14 +27,15 @@ hex-literal = "0.3"
aead = { version = "0.5", features = ["alloc"] }

[features]
default = ["alloc", "getrandom", "zeroize"]
default = ["alloc", "getrandom"]
std = ["aead/std", "alloc"]
alloc = ["aead/alloc"]
arrayvec = ["aead/arrayvec"]
getrandom = ["aead/getrandom", "rand_core"]
heapless = ["aead/heapless"]
rand_core = ["aead/rand_core"]
stream = ["aead/stream"]
zeroize = ["zeroize_crate", "ascon/zeroize"]

[package.metadata.docs.rs]
all-features = true
Expand Down
3 changes: 3 additions & 0 deletions ascon-aead/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
//! Similarly, enabling the `arrayvec` feature of this crate will provide an impl of
//! [`aead::Buffer`] for `arrayvec::ArrayVec`.

#[cfg(feature = "zeroize")]
extern crate zeroize_crate as zeroize;

pub use aead::{self, Error, Key, Nonce, Tag};
use aead::{
consts::{U0, U16, U20},
Expand Down

0 comments on commit 96fd7cf

Please sign in to comment.