diff --git a/Crypto/Random.hs b/Crypto/Random.hs new file mode 100644 index 0000000..5f73a8e --- /dev/null +++ b/Crypto/Random.hs @@ -0,0 +1,32 @@ +-- Module : Crypto.Random +-- License : BSD-style +-- Maintainer : Vincent Hanquez +-- Stability : stable +-- Portability : good +-- +module Crypto.Random + ( + -- * Deterministic instances + ChaChaDRG + -- * Deterministic Random class + , drgNew + , drgNewTest + , withDRG + , DRG(..) + -- * Random abstraction + , MonadRandom(..) + ) where + +import Crypto.Random.Types +import Crypto.Random.ChaChaDRG +import Crypto.Random.Entropy +import Crypto.Internal.Memory + +import Control.Applicative +import Data.Word (Word64) + +drgNew :: IO ChaChaDRG +drgNew = initialize <$> (getEntropy 40 :: IO SecureBytes) + +drgNewTest :: (Word64, Word64, Word64, Word64, Word64) -> ChaChaDRG +drgNewTest = initializeWords diff --git a/cryptonite.cabal b/cryptonite.cabal index 72bff6a..02660b8 100644 --- a/cryptonite.cabal +++ b/cryptonite.cabal @@ -59,6 +59,7 @@ Library Crypto.Hash.Tiger Crypto.Hash.Whirlpool Crypto.PubKey.Curve25519 + Crypto.Random Crypto.Random.Types Crypto.Random.Entropy Crypto.Random.EntropyPool