3636#![ cfg_attr( docsrs, feature( doc_cfg) ) ]
3737#![ no_std]
3838
39- #[ cfg( feature = "std" ) ]
40- extern crate std;
41-
4239use core:: { fmt, ops:: DerefMut } ;
4340
4441pub mod block;
4542pub mod le;
46- #[ cfg( feature = "os_rng" ) ]
47- mod os;
48-
49- #[ cfg( feature = "os_rng" ) ]
50- pub use os:: { OsError , OsRng } ;
5143
5244/// Implementation-level interface for RNGs
5345///
@@ -168,6 +160,8 @@ where
168160/// An optional property of CSPRNGs is backtracking resistance: if the CSPRNG's
169161/// state is revealed, it will not be computationally-feasible to reconstruct
170162/// prior output values. This property is not required by `CryptoRng`.
163+ ///
164+ /// [`OsRng`]: https://docs.rs/rand/latest/rand/rngs/struct.OsRng.html
171165pub trait CryptoRng : RngCore { }
172166
173167impl < T : DerefMut > CryptoRng for T where T :: Target : CryptoRng { }
@@ -184,6 +178,8 @@ impl<T: DerefMut> CryptoRng for T where T::Target: CryptoRng {}
184178/// An implementation of this trait may be made compatible with code requiring
185179/// an [`RngCore`] through [`TryRngCore::unwrap_err`]. The resulting RNG will
186180/// panic in case the underlying fallible RNG yields an error.
181+ ///
182+ /// [`OsRng`]: https://docs.rs/rand/latest/rand/rngs/struct.OsRng.html
187183pub trait TryRngCore {
188184 /// The type returned in the event of a RNG error.
189185 type Error : fmt:: Debug + fmt:: Display ;
@@ -246,6 +242,8 @@ impl<R: RngCore + ?Sized> TryRngCore for R {
246242/// `default()` instances are themselves secure generators: for example if the
247243/// implementing type is a stateless interface over a secure external generator
248244/// (like [`OsRng`]) or if the `default()` instance uses a strong, fresh seed.
245+ ///
246+ /// [`OsRng`]: https://docs.rs/rand/latest/rand/rngs/struct.OsRng.html
249247pub trait TryCryptoRng : TryRngCore { }
250248
251249impl < R : CryptoRng + ?Sized > TryCryptoRng for R { }
0 commit comments