raaz-0.0.1: The raaz cryptographic library.

Safe HaskellNone
LanguageHaskell98

Raaz.Core.Random

Synopsis

Documentation

class InfiniteSource prg => PRG prg where Source #

The class that captures pseudo-random generators. Essentially the a pseudo-random generator (PRG) is a byte sources that can be seeded.

Minimal complete definition

newPRG, reseed

Associated Types

type Seed prg :: * Source #

Associated type that captures the seed for the PRG.

Methods

newPRG :: Seed prg -> IO prg Source #

Creates a new pseudo-random generators

reseed :: Seed prg -> prg -> IO () Source #

Re-seeding the prg.

Instances

class Random r where Source #

Stuff that can be generated by a pseudo-random generator.

Methods

random :: PRG prg => prg -> IO r Source #

random :: (PRG prg, Storable r) => prg -> IO r Source #

Instances

Random Word Source # 

Methods

random :: PRG prg => prg -> IO Word Source #

Random Word16 Source # 

Methods

random :: PRG prg => prg -> IO Word16 Source #

Random Word32 Source # 

Methods

random :: PRG prg => prg -> IO Word32 Source #

Random Word64 Source # 

Methods

random :: PRG prg => prg -> IO Word64 Source #

Random IV Source # 

Methods

random :: PRG prg => prg -> IO IV Source #

Random KEY256 Source # 

Methods

random :: PRG prg => prg -> IO KEY256 Source #

Random KEY192 Source # 

Methods

random :: PRG prg => prg -> IO KEY192 Source #

Random KEY128 Source # 

Methods

random :: PRG prg => prg -> IO KEY128 Source #

Random w => Random (BE w) Source # 

Methods

random :: PRG prg => prg -> IO (BE w) Source #

Random w => Random (LE w) Source # 

Methods

random :: PRG prg => prg -> IO (LE w) Source #

(Random a, Random b) => Random (a, b) Source # 

Methods

random :: PRG prg => prg -> IO (a, b) Source #

(Random a, Random b, Random c) => Random (a, b, c) Source # 

Methods

random :: PRG prg => prg -> IO (a, b, c) Source #

data SystemPRG Source #

The system wide pseudo-random generator. The source is expected to be of high quality, albeit a bit slow due to system call overheads. It is expected that this source is automatically seeded from the entropy pool maintained by the platform. Hence, it is neither necessary nor possible to seed this generator which reflected by the fact that the associated type Seed SystemPRG is the unit type ().