Skip to content

Commit

Permalink
Implement CryptoRng for ReseedingRng
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Mar 14, 2018
1 parent 475ee56 commit f99f9cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/reseeding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! A wrapper around another PRNG that reseeds it after it
//! generates a certain number of random bytes.

use rand_core::{RngCore, BlockRngCore, SeedableRng, Error, ErrorKind};
use rand_core::{RngCore, BlockRngCore, CryptoRng, SeedableRng, Error, ErrorKind};
use rand_core::impls::BlockRng;

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

impl<R, Rsdr> CryptoRng for ReseedingRng<R, Rsdr>
where R: BlockRngCore<u32> + SeedableRng + CryptoRng,
Rsdr: RngCore {}

#[cfg(test)]
mod test {
use {Rng, SeedableRng};
Expand Down

0 comments on commit f99f9cb

Please sign in to comment.