cprng-aes-0.6.1: Crypto Pseudo Random Number Generator using AES in counter mode.

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | stable
Portability | unknown
Safe Haskell | None
Language | Haskell98

Crypto.Random.AESCtr

Description

this CPRNG is an AES based counter system.

the internal size of fields are: 16 bytes IV, 16 bytes counter, 32 bytes key

each block are generated the following way: aes (IV `xor` counter) -> 16 bytes output

Synopsis

- data AESRNG
- make :: EntropyPool -> AESRNG
- makeSystem :: IO AESRNG

# Documentation

data AESRNG Source #

AES Counter mode Pseudo random generator.

Provide a very good Cryptographic pseudo random generator that create pseudo random output based an AES cipher used in counter mode, initialized from random key, random IV and random nonce.

This CPRG uses 64 bytes of pure entropy to create its random state.

By default, this generator will automatically reseed after generating 1 megabyte of data.

Instances

Show AESRNG Source # |
Methods showsPrec :: Int -> AESRNG -> ShowS # show :: AESRNG -> String # showList :: [AESRNG] -> ShowS #
CPRG AESRNG Source # |
Methods cprgCreate :: EntropyPool -> AESRNG # cprgSetReseedThreshold :: Int -> AESRNG -> AESRNG # cprgFork :: AESRNG -> (AESRNG, AESRNG) # cprgGenerate :: Int -> AESRNG -> (ByteString, AESRNG) # cprgGenerateWithEntropy :: Int -> AESRNG -> (ByteString, AESRNG) #

make :: EntropyPool -> AESRNG Source #

make an AES RNG from an EntropyPool.

use `makeSystem` to not have to deal with the entropy pool.

makeSystem :: IO AESRNG Source #

Initialize a new AES RNG using the system entropy. {--}