crypto-random-0.0.9: Simple cryptographic random related types

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | Good
Safe Haskell | None
Language | Haskell98

Crypto.Random.Test

Description

Provide way to test usual simple statisticals test for randomness

Synopsis

- data RandomTestState
- data RandomTestResult = RandomTestResult {
  - res_totalChars :: Word64
  - res_entropy :: Double
  - res_chi_square :: Double
  - res_mean :: Double
  - res_compressionPercent :: Double
  - res_probs :: [Double]
  }
- randomTestInitialize :: IO RandomTestState
- randomTestAppend :: RandomTestState -> ByteString -> IO ()
- randomTestFinalize :: RandomTestState -> IO RandomTestResult

# Documentation

data RandomTestState #

Mutable random test State

data RandomTestResult #

Randomness various result relative to random bytes

Constructors

RandomTestResult |
Fields res_totalChars :: Word64 Total number of characters res_entropy :: Double Entropy per byte res_chi_square :: Double Chi Square res_mean :: Double Arithmetic Mean res_compressionPercent :: Double Theorical Compression percent res_probs :: [Double] Probability of every bucket

Instances

Eq RandomTestResult # |
Methods (==) :: RandomTestResult -> RandomTestResult -> Bool # (/=) :: RandomTestResult -> RandomTestResult -> Bool #
Show RandomTestResult # |
Methods showsPrec :: Int -> RandomTestResult -> ShowS # show :: RandomTestResult -> String # showList :: [RandomTestResult] -> ShowS #

randomTestInitialize :: IO RandomTestState #

Initialize new state to run tests

randomTestAppend :: RandomTestState -> ByteString -> IO () #

Append random data to the test state

randomTestFinalize :: RandomTestState -> IO RandomTestResult #

Finalize random test state into some result