cryptonite-0.27: Cryptography Primitives sink
License BSD-style
Maintainer Vincent Hanquez <vincent@snarc.org>
Stability experimental
Portability Good
Safe Haskell None
Language Haskell2010

Crypto.Random.Types

Description

Synopsis

Documentation

class Monad m => MonadRandom m where Source #

A monad constraint that allows to generate random bytes

Methods

getRandomBytes :: ByteArray byteArray => Int -> m byteArray Source #

Instances

Instances details
MonadRandom IO Source #
Instance details

Defined in Crypto.Random.Types

Methods

getRandomBytes :: ByteArray byteArray => Int -> IO byteArray Source #

DRG gen => MonadRandom ( MonadPseudoRandom gen) Source #
Instance details

Defined in Crypto.Random.Types

data MonadPseudoRandom gen a Source #

A simple Monad class very similar to a State Monad with the state being a DRG.

class DRG gen where Source #

A Deterministic Random Generator (DRG) class

Methods

randomBytesGenerate :: ByteArray byteArray => Int -> gen -> (byteArray, gen) Source #

Generate N bytes of randomness from a DRG

withDRG :: DRG gen => gen -> MonadPseudoRandom gen a -> (a, gen) Source #

Run a pure computation with a Deterministic Random Generator in the MonadPseudoRandom