From ed7eea2a23ab273111c0ce3718de8000917e3783 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 30 Sep 2024 13:15:09 -0600 Subject: [PATCH] crypto-common: remove `std` feature 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`. --- .github/workflows/crypto-common.yml | 1 - aead/Cargo.toml | 2 +- cipher/Cargo.toml | 2 +- crypto-common/Cargo.toml | 1 - digest/Cargo.toml | 2 +- universal-hash/Cargo.toml | 2 +- 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/crypto-common.yml b/.github/workflows/crypto-common.yml index 0f53a686b..3c4e4edf7 100644 --- a/.github/workflows/crypto-common.yml +++ b/.github/workflows/crypto-common.yml @@ -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 diff --git a/aead/Cargo.toml b/aead/Cargo.toml index f6cccaeaa..b0a7bc25b 100644 --- a/aead/Cargo.toml +++ b/aead/Cargo.toml @@ -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"] diff --git a/cipher/Cargo.toml b/cipher/Cargo.toml index 0afe98fb0..c0a87c0d4 100644 --- a/cipher/Cargo.toml +++ b/cipher/Cargo.toml @@ -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"] diff --git a/crypto-common/Cargo.toml b/crypto-common/Cargo.toml index 8eddb6f91..908c4c8d2 100644 --- a/crypto-common/Cargo.toml +++ b/crypto-common/Cargo.toml @@ -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 diff --git a/digest/Cargo.toml b/digest/Cargo.toml index 32a221b78..c0e219fda 100644 --- a/digest/Cargo.toml +++ b/digest/Cargo.toml @@ -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] diff --git a/universal-hash/Cargo.toml b/universal-hash/Cargo.toml index d330e0679..2b0042572 100644 --- a/universal-hash/Cargo.toml +++ b/universal-hash/Cargo.toml @@ -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