diff --git a/Cargo.toml b/Cargo.toml index 4a36402..b914648 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,6 @@ categories = ["cryptography", "no-std"] keywords = ["rustls", "tls"] edition = "2021" rust-version = "1.75" -resolver = "1" # Hack to enable the `custom` feature of `getrandom` # Ensure all dependencies + feats are mapped to crate features for correct usage # default features often have std breaking no_std and potentially other unwanted diff --git a/src/lib.rs b/src/lib.rs index 741778c..ba06a8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,6 +65,12 @@ pub fn provider() -> CryptoProvider { } } +#[cfg(feature = "alloc")] +pub fn provider_and_init_rng(rng: Box) -> CryptoProvider { + init_randomness_source(rng); + provider() +} + // TODO: switch to ThinBox once it is available #[cfg(feature = "alloc")] static mut RNG: OnceCell> = OnceCell::new();