Skip to content

Commit f99f9cb

Browse files
committed
Implement CryptoRng for ReseedingRng
1 parent 475ee56 commit f99f9cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/reseeding.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! A wrapper around another PRNG that reseeds it after it
1212
//! generates a certain number of random bytes.
1313
14-
use rand_core::{RngCore, BlockRngCore, SeedableRng, Error, ErrorKind};
14+
use rand_core::{RngCore, BlockRngCore, CryptoRng, SeedableRng, Error, ErrorKind};
1515
use rand_core::impls::BlockRng;
1616

1717
/// A wrapper around any PRNG which reseeds the underlying PRNG after it has
@@ -197,6 +197,10 @@ where R: BlockRngCore<u32> + SeedableRng,
197197
}
198198
}
199199

200+
impl<R, Rsdr> CryptoRng for ReseedingRng<R, Rsdr>
201+
where R: BlockRngCore<u32> + SeedableRng + CryptoRng,
202+
Rsdr: RngCore {}
203+
200204
#[cfg(test)]
201205
mod test {
202206
use {Rng, SeedableRng};

0 commit comments

Comments
 (0)