Safe Haskell | None |
---|
This module provides a cryptographically secure PRNG based on AES, reading the seed from devurandom
- randBytes :: Int -> IO ByteString
- prandBytes :: Int -> IO ByteString
- data AESGen
- newAESGen :: IO AESGen
Documentation
randBytes :: Int -> IO ByteStringSource
Randomness from a system source of nonsense such as devurandom
prandBytes :: Int -> IO ByteStringSource
Cryptographic pseudorandomness from an AES cipher. This function is currently inefficient for non-multiple-of-16 sized bytestrings.
A random number generator that gets its input from prandBytes, ensuring purity by storing those bytes for later if you don't discard the generator.
Using split on this generator isn't supported, but could be.
Please note that if an asynchronous exception is caught while a random number is being generated, the generator will be wrecked forevermore.