diff --git a/Cargo.lock b/Cargo.lock index 8d509c552..624cd8f19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -304,6 +304,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "group" version = "0.10.0" @@ -424,6 +435,9 @@ name = "rand_core" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] [[package]] name = "rustc_version" @@ -603,6 +617,12 @@ dependencies = [ "vcell", ] +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + [[package]] name = "wyz" version = "0.4.0" diff --git a/aead/Cargo.toml b/aead/Cargo.toml index a0eda058c..5660ff0ee 100644 --- a/aead/Cargo.toml +++ b/aead/Cargo.toml @@ -17,13 +17,14 @@ categories = ["cryptography", "no-std"] [dependencies] generic-array = { version = "0.14", default-features = false } +# optional dependencies blobby = { version = "0.3", optional = true } heapless = { version = "0.7", optional = true, default-features = false } rand_core = { version = "0.6", optional = true } [features] -std = ["alloc"] alloc = [] +std = ["alloc", "rand_core/std"] dev = ["blobby"] stream = [] diff --git a/aead/src/lib.rs b/aead/src/lib.rs index 9ddcec352..0ff10d41f 100644 --- a/aead/src/lib.rs +++ b/aead/src/lib.rs @@ -40,10 +40,12 @@ pub mod stream; pub use generic_array::{self, typenum::consts}; #[cfg(feature = "heapless")] +#[cfg_attr(docsrs, doc(cfg(feature = "heapless")))] pub use heapless; #[cfg(feature = "rand_core")] -use rand_core::{CryptoRng, RngCore}; +#[cfg_attr(docsrs, doc(cfg(feature = "rand_core")))] +pub use rand_core; use core::fmt; use generic_array::{typenum::Unsigned, ArrayLength, GenericArray}; @@ -51,6 +53,9 @@ use generic_array::{typenum::Unsigned, ArrayLength, GenericArray}; #[cfg(feature = "alloc")] use alloc::vec::Vec; +#[cfg(feature = "rand_core")] +use rand_core::{CryptoRng, RngCore}; + /// Error type. /// /// This type is deliberately opaque as to avoid potential side-channel