Skip to content

Commit

Permalink
crypto-common: weakly activate rand_core/getrandom (#1381)
Browse files Browse the repository at this point in the history
When both `getrandom` and `rand_core` are enabled, activates the
`rand_core/getrandom` feature, which makes `OsRng` available as
`crypto_common::rand_core::OsRng`.
  • Loading branch information
tarcieri authored Nov 12, 2023
1 parent 1d0810d commit b6b591e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crypto-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rand_core = { version = "0.6.4", optional = true }
getrandom = { version = "0.2", optional = true }

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

[package.metadata.docs.rs]
Expand Down
2 changes: 2 additions & 0 deletions crypto-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#[cfg(feature = "std")]
extern crate std;

#[cfg(feature = "getrandom")]
pub use getrandom;
#[cfg(feature = "rand_core")]
pub use rand_core;

Expand Down

0 comments on commit b6b591e

Please sign in to comment.