[random] export MonadPseudoRandom
This commit is contained in:
parent
05e0e1a587
commit
ca2ec5a03d
@ -16,6 +16,7 @@ module Crypto.Random
|
|||||||
, DRG(..)
|
, DRG(..)
|
||||||
-- * Random abstraction
|
-- * Random abstraction
|
||||||
, MonadRandom(..)
|
, MonadRandom(..)
|
||||||
|
, MonadPseudoRandom(..)
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Crypto.Random.Types
|
import Crypto.Random.Types
|
||||||
|
|||||||
16
tests/Number.hs
Normal file
16
tests/Number.hs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
module Number (tests) where
|
||||||
|
|
||||||
|
import Imports
|
||||||
|
|
||||||
|
import Crypto.Number.Basic
|
||||||
|
import Data.Bits
|
||||||
|
|
||||||
|
tests = testGroup "number"
|
||||||
|
[ testProperty "num-bits" $ \(Positive i) ->
|
||||||
|
and [ (numBits (2^i-1) == i)
|
||||||
|
, (numBits (2^i) == i+1)
|
||||||
|
, (numBits (2^i + (2^i-1)) == i+1)
|
||||||
|
]
|
||||||
|
, testProperty "num-bits2" $ \(Positive i) ->
|
||||||
|
not (i `testBit` numBits i) && (i `testBit` (numBits i - 1))
|
||||||
|
]
|
||||||
Loading…
Reference in New Issue
Block a user