Crypto.Random.Entropy.Unsafe

cryptonite-0.20: Cryptography Primitives sink

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | Good
Safe Haskell | Safe
Language | Haskell2010

Crypto.Random.Entropy.Unsafe

Description

Synopsis

- replenish :: Int -> [EntropyBackend] -> Ptr Word8 -> IO ()
- data EntropyBackend
- supportedBackends :: [IO (Maybe EntropyBackend)]
- gatherBackend :: EntropyBackend -> Ptr Word8 -> Int -> IO Int

# Documentation

replenish :: Int -> [EntropyBackend] -> Ptr Word8 -> IO () #

Refill the entropy in a buffer

call each entropy backend in turn until the buffer has been replenish.

If the buffer cannot be refill after 3 loopings, this will raise an User Error exception

data EntropyBackend #

Any Entropy Backend

supportedBackends :: [IO (Maybe EntropyBackend)] #

All supported backends

gatherBackend #

Arguments

:: EntropyBackend | An open Entropy Backend
-> Ptr Word8 | Pointer to a buffer to write to
-> Int | number of bytes to write
-> IO Int | return the number of bytes actually written

Gather randomness from an open handle