Safe Haskell | None |
---|
- type RNG = State SystemRNG
- runRNG :: SetMember Lift (Lift IO) r => Eff (RNG :> (Reader EntropyPool :> r)) a -> Eff r a
- runRNGWithPool :: SetMember Lift (Lift IO) r => EntropyPool -> Eff (RNG :> (Reader EntropyPool :> r)) a -> Eff r a
- withRNG :: Member RNG r => (SystemRNG -> Eff r (a, SystemRNG)) -> Eff r a
- withRNGIO :: (SetMember Lift (Lift IO) r, Member RNG r) => (SystemRNG -> IO (a, SystemRNG)) -> Eff r a
- rngFork :: Member RNG r => Eff r SystemRNG
- randomBytes :: Member RNG r => Int -> Eff r ByteString
- randomBytesWithEntropy :: Member RNG r => Int -> Eff r ByteString
- withRandomBytes :: Member RNG r => Int -> (ByteString -> Eff r a) -> Eff r a
- createEntropyPool :: SetMember Lift (Lift IO) r => Eff r EntropyPool
- grabEntropy :: (SetMember Lift (Lift IO) r, Member (Reader EntropyPool) r) => Int -> Eff r SecureMem
- unsafeGrabEntropy :: Member (Reader EntropyPool) r => Int -> Eff r SecureMem
- class CPRG gen
- data SystemRNG
- data EntropyPool
Documentation
runRNG :: SetMember Lift (Lift IO) r => Eff (RNG :> (Reader EntropyPool :> r)) a -> Eff r aSource
Run the effect.
runRNGWithPool :: SetMember Lift (Lift IO) r => EntropyPool -> Eff (RNG :> (Reader EntropyPool :> r)) a -> Eff r aSource
withRNGIO :: (SetMember Lift (Lift IO) r, Member RNG r) => (SystemRNG -> IO (a, SystemRNG)) -> Eff r aSource
randomBytes :: Member RNG r => Int -> Eff r ByteStringSource
randomBytesWithEntropy :: Member RNG r => Int -> Eff r ByteStringSource
withRandomBytes :: Member RNG r => Int -> (ByteString -> Eff r a) -> Eff r aSource
createEntropyPool :: SetMember Lift (Lift IO) r => Eff r EntropyPoolSource
grabEntropy :: (SetMember Lift (Lift IO) r, Member (Reader EntropyPool) r) => Int -> Eff r SecureMemSource
unsafeGrabEntropy :: Member (Reader EntropyPool) r => Int -> Eff r SecureMemSource
reexports from 'crypto-random'
data SystemRNG
System entropy generator.
This generator doesn't use the entropy reseed level, as the only bytes generated are comping from the entropy pool already.
This generator doesn't create reproducible output, and might be difficult to use for testing and debugging purpose, but otherwise for real world use case should be fine.
data EntropyPool
Pool of Entropy. contains a self mutating pool of entropy, that is always guarantee to contains data.