Skip to content

Commit

Permalink
zeroize default-features = false, correct sha2 msrv handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Nov 12, 2023
1 parent 1d46e95 commit 2db62e9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion blake2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = ["cryptography", "no-std"]

[dependencies]
digest = { version = "0.10.7", features = ["mac"] }
zeroize = { version = "1", features = ["derive"], optional = true }
zeroize = { version = "1", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
digest = { version = "0.10.7", features = ["dev"] }
Expand Down
2 changes: 1 addition & 1 deletion sha1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = ["cryptography", "no-std"]
[dependencies]
digest = "0.10.7"
cfg-if = "1.0"
zeroize = { version = "1", optional = true }
zeroize = { version = "1", default-features = false, optional = true }

[target.'cfg(any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64"))'.dependencies]
cpufeatures = "0.2"
Expand Down
6 changes: 3 additions & 3 deletions sha2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories = ["cryptography", "no-std"]
[dependencies]
digest = "0.10.7"
cfg-if = "1.0"
zeroize = { version = "1", optional = true }
zeroize_crate = { package = "zeroize", version = "1", default-features = false, optional = true }

[target.'cfg(any(target_arch = "aarch64", target_arch = "x86_64", target_arch = "x86"))'.dependencies]
cpufeatures = "0.2"
Expand All @@ -29,7 +29,7 @@ hex-literal = "0.2.2"

[features]
default = ["std"]
std = ["digest/std", "zeroize?/std"]
std = ["digest/std", "zeroize_crate?/std"]
oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57
asm = ["sha2-asm"] # WARNING: this feature SHOULD NOT be enabled by library crates
# Use assembly backend for LoongArch64 targets
Expand All @@ -38,7 +38,7 @@ loongarch64_asm = []
compress = [] # Expose compress functions
force-soft = [] # Force software implementation
asm-aarch64 = ["asm"] # DEPRECATED: use `asm` instead
zeroize = ["dep:zeroize"] # Implement Zeroize for Digest implementors
zeroize = ["zeroize_crate"] # Implement Zeroize for Digest implementors

[package.metadata.docs.rs]
all-features = true
Expand Down
4 changes: 2 additions & 2 deletions sha2/src/core_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl AlgorithmName for Sha256VarCore {
}

#[cfg(feature = "zeroize")]
impl zeroize::Zeroize for Sha256VarCore {
impl zeroize_crate::Zeroize for Sha256VarCore {
fn zeroize(&mut self) {
self.state.zeroize();
self.block_len.zeroize();
Expand Down Expand Up @@ -178,7 +178,7 @@ impl AlgorithmName for Sha512VarCore {
}

#[cfg(feature = "zeroize")]
impl zeroize::Zeroize for Sha512VarCore {
impl zeroize_crate::Zeroize for Sha512VarCore {
fn zeroize(&mut self) {
self.state.zeroize();
self.block_len.zeroize();
Expand Down
2 changes: 1 addition & 1 deletion sha3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ hex-literal = "0.2.2"

[features]
default = ["std"]
std = ["digest/std"]
std = ["digest/std", "zeroize?/std"]

asm = ["keccak/asm"] # Enable ASM (currently ARMv8 only). WARNING: Bumps MSRV to 1.59
oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57
Expand Down

0 comments on commit 2db62e9

Please sign in to comment.