Skip to content

Commit

Permalink
crypto-common: remove std feature (#1680)
Browse files Browse the repository at this point in the history
As of #1660, the `crypto-common` crate stopped linking `std` entirely by
switching to `core::error::Error`.

That PR didn't remove the `std` feature however, which was retained to
transitively activate the `std` features of `getrandom` and `rand_core`
optioinally in the event their corresponding features are enabled.

This PR goes ahead and removes it entirely, which also unblocks being
able to remove the `std` feature from other crates like `aead`,
`cipher`, `digest`, and `universal-hash`.
  • Loading branch information
tarcieri authored Sep 30, 2024
1 parent 7bc0952 commit 6077990
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/crypto-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,4 @@ jobs:
toolchain: ${{ matrix.rust }}
- run: cargo check --all-features
- run: cargo test
- run: cargo test --features std
- run: cargo test --all-features
2 changes: 1 addition & 1 deletion aead/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ heapless = { version = "0.8", optional = true, default-features = false }
[features]
default = ["rand_core"]
alloc = []
std = ["alloc", "crypto-common/std"]
std = ["alloc"]
dev = ["blobby"]
getrandom = ["crypto-common/getrandom"]
rand_core = ["crypto-common/rand_core"]
Expand Down
2 changes: 1 addition & 1 deletion cipher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ zeroize = { version = "1.8", optional = true, default-features = false }

[features]
alloc = []
std = ["alloc", "crypto-common/std"]
std = ["alloc"]
block-padding = ["inout/block-padding"]
# Enable random key and IV generation methods
rand_core = ["crypto-common/rand_core"]
Expand Down
1 change: 0 additions & 1 deletion crypto-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ getrandom = { version = "0.2", optional = true }

[features]
getrandom = ["dep:getrandom", "rand_core?/getrandom"]
std = ["getrandom?/std", "rand_core?/std"]

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion digest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rand_core = ["crypto-common/rand_core"] # Enable random key generation methods
oid = ["const-oid"]
zeroize = ["dep:zeroize", "block-buffer?/zeroize"]
alloc = []
std = ["alloc", "crypto-common/std"]
std = ["alloc"]
dev = ["blobby"]

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion universal-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ crypto-common = "0.2.0-rc.0"
subtle = { version = "2.4", default-features = false }

[features]
std = ["crypto-common/std"]
std = []

[package.metadata.docs.rs]
all-features = true
Expand Down

0 comments on commit 6077990

Please sign in to comment.