diff --git a/Crypto/Random.hs b/Crypto/Random.hs index 37d4124..4cea74b 100644 --- a/Crypto/Random.hs +++ b/Crypto/Random.hs @@ -80,6 +80,10 @@ drgNewSeed (Seed seed) = initialize seed -- -- It can also be used in other contexts provided the input -- has been properly randomly generated. +-- +-- Note that the @Arbitrary@ instance provided by QuickCheck for 'Word64' does +-- not have a uniform distribution. It is often better to use instead +-- @arbitraryBoundedRandom@. drgNewTest :: (Word64, Word64, Word64, Word64, Word64) -> ChaChaDRG drgNewTest = initializeWords diff --git a/tests/Utils.hs b/tests/Utils.hs index 03ba521..bf16bb4 100644 --- a/tests/Utils.hs +++ b/tests/Utils.hs @@ -19,7 +19,7 @@ newtype TestDRG = TestDRG (Word64, Word64, Word64, Word64, Word64) deriving (Show,Eq) instance Arbitrary TestDRG where - arbitrary = TestDRG `fmap` arbitrary + arbitrary = TestDRG `fmap` arbitrary -- distribution not uniform withTestDRG (TestDRG l) f = fst $ withDRG (drgNewTest l) f