Skip to content

Commit

Permalink
ascon-aead: Add ascon sponge Zeroize feature
Browse files Browse the repository at this point in the history
Not zeroizing the state may expose the private key.
  • Loading branch information
aewag committed Oct 24, 2023
1 parent 36546a0 commit 0fc86bd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
34 changes: 9 additions & 25 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions ascon-aead/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@ 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.3"
ascon = "0.4"

[dev-dependencies]
hex = "0.4"
aead = { version = "0.5", features = ["alloc"] }
spectral = { version = "0.6", default-features = false }

[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 0fc86bd

Please sign in to comment.