Skip to main content

reseeding_csprng

Function reseeding_csprng 

Source
pub fn reseeding_csprng<T: TryRngCore>(
    trng: T,
    reseed_threshold: u64,
) -> Result<RngAdaptor<ReseedingRng<ChaCha12Core, T>>, T::Error>
Expand description

Create a reseeding CSPRNG using ChaCha12Core as the underlying PRNG. A good default as an argument to the various rs-matter crypto backends, especially in baremetal environments.

§Arguments

  • trng: The true random number generator to use for reseeding.
  • reseed_threshold: The number of bytes to generate before reseeding.

§Returns

An adaptor wrapping the reseeding RNG, or an error if the underlying TRNG fails to initialize.