fn reseed_prng(&mut self, entropy: &[u8]) {
        // Need to fill a fixed size array for the from_seed, so we'll do 256 bit
        // array and has the entropy into it.
        let mut digest = Sha256::new();
        digest.input(entropy);
        let hash = digest.result();
        let mut entropy_array: [u8; SEED_BYTES] = [0; SEED_BYTES];
        entropy_array.copy_from_slice(hash.as_slice());
        self.prng = ChaCha20Rng::from_seed(entropy_array);
    }
/// Reseed the CSPRNG with the supplied entropy.
/// TODO add this to an entropy pool and give a limited estimate to the amount of entropy
/// TODO consider having trusted and untrusted entropy URIs, with different permissions.
Reseed the CSPRNG with the supplied entropy.
TODO add this to an entropy pool and give a limited estimate to the amount of entropy
TODO consider having trusted and untrusted entropy URIs, with different permissions.
Reseed the CSPRNG with the supplied entropy . TODO add this to an entropy pool and give a limited estimate to the amount of entropy TODO consider having trusted and untrusted entropy URIs with different permissions .
fn reseed_prng(&mut self, entropy: &[u8]) {
        // Need to fill a fixed size array for the from_seed, so we'll do 256 bit
        // array and has the entropy into it.
        let mut digest = Sha256::new();
        digest.input(entropy);
        let hash = digest.result();
        let mut entropy_array: [u8; SEED_BYTES] = [0; SEED_BYTES];
        entropy_array.copy_from_slice(hash.as_slice());
        self.prng = ChaCha20Rng::from_seed(entropy_array);
    }
fn reseed_prng ( & mut self , entropy : & [ u8 ] ) { // Need to fill a fixed size array for the from_seed, so we'll do 256 bit // array and has the entropy into it. let mut digest = Sha256 :: new ( ) ; digest . input ( entropy ) ; let hash = digest . result ( ) ; let mut entropy_array : [ u8 ; SEED_BYTES ] = [ 0 ; SEED_BYTES ] ; entropy_array . copy_from_slice ( hash . as_slice ( ) ) ; self . prng = ChaCha20Rng :: from_seed ( entropy_array ) ; }
Reseed the CSPRNG with the supplied entropy.
Reseed the CSPRNG with the supplied entropy .
&mut self
entropy
&[u8]
&mut self
entropy
&[u8]