diff --git a/Crypto/Random.hs b/Crypto/Random.hs index d270b82..bd89f0d 100644 --- a/Crypto/Random.hs +++ b/Crypto/Random.hs @@ -26,8 +26,10 @@ import Data.ByteArray (ScrubbedBytes) import Crypto.Internal.Imports -- | Create a new DRG from system entropy -drgNew :: IO ChaChaDRG -drgNew = initialize <$> (getEntropy 40 :: IO ScrubbedBytes) +drgNew :: MonadRandom randomly => randomly ChaChaDRG +drgNew = do + b <- getRandomBytes 40 + return $ initialize (b :: ScrubbedBytes) -- | Create a new DRG from 5 Word64. --