Copyright | (c) Eric Crockett 2011-2017 Chris Peikert 2011-2017 |
---|---|
License | GPL-3 |
Maintainer | ecrockett0@email.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Defines a newtype wrapper CryptoRand
for crypto-api's
CryptoRandomGen
, and a corresponding RandomGen
wrapper
instance. These are needed because CryptoRandomGen
generators
can only be used to get Data.ByteStrings; the RandomGen
wrapper
instance allows them to be used to generate any Random
type.
Synopsis
- data CryptoRand g
- evalCryptoRandIO :: (CryptoRandomGen g, MonadIO io) => RandT g io a -> io a
Documentation
data CryptoRand g Source #
Turns a CryptoRandomGen
g
into a standard RandomGen
.
Instances
CryptoRandomGen g => RandomGen (CryptoRand g) Source # | |
Defined in Crypto.Lol.Types.Random next :: CryptoRand g -> (Int, CryptoRand g) # genRange :: CryptoRand g -> (Int, Int) # split :: CryptoRand g -> (CryptoRand g, CryptoRand g) # | |
CryptoRandomGen g => CryptoRandomGen (CryptoRand g) Source # | |
Defined in Crypto.Lol.Types.Random newGen :: ByteString -> Either GenError (CryptoRand g) # genSeedLength :: Tagged (CryptoRand g) ByteLength # genBytes :: ByteLength -> CryptoRand g -> Either GenError (ByteString, CryptoRand g) # reseedInfo :: CryptoRand g -> ReseedInfo # reseedPeriod :: CryptoRand g -> ReseedInfo # genBytesWithEntropy :: ByteLength -> ByteString -> CryptoRand g -> Either GenError (ByteString, CryptoRand g) # reseed :: ByteString -> CryptoRand g -> Either GenError (CryptoRand g) # newGenIO :: IO (CryptoRand g) # |
evalCryptoRandIO :: (CryptoRandomGen g, MonadIO io) => RandT g io a -> io a Source #
Evaluate a RandT
computation using a cryptographic generator
g
, seeded by system entropy. Note that the updated generator is
not returned.