[Random] allow drgNew to be run in any MonadRandom directly.
this allow cascading, create a DRG from another DRG
This commit is contained in:
parent
0d2290a4a1
commit
0b6b2d661c
@ -26,8 +26,10 @@ import Data.ByteArray (ScrubbedBytes)
|
|||||||
import Crypto.Internal.Imports
|
import Crypto.Internal.Imports
|
||||||
|
|
||||||
-- | Create a new DRG from system entropy
|
-- | Create a new DRG from system entropy
|
||||||
drgNew :: IO ChaChaDRG
|
drgNew :: MonadRandom randomly => randomly ChaChaDRG
|
||||||
drgNew = initialize <$> (getEntropy 40 :: IO ScrubbedBytes)
|
drgNew = do
|
||||||
|
b <- getRandomBytes 40
|
||||||
|
return $ initialize (b :: ScrubbedBytes)
|
||||||
|
|
||||||
-- | Create a new DRG from 5 Word64.
|
-- | Create a new DRG from 5 Word64.
|
||||||
--
|
--
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user