Skip to content

Commit

Permalink
Documentation fixes (formatting)
Browse files Browse the repository at this point in the history
Ignore-this: 3ea22ce39fdc7b6aeb2acaa7c2945763

darcs-hash:20100907154608-cef97-5f81e242d34822f62d3f588045176658c51fca12.gz
  • Loading branch information
TomMD committed Sep 7, 2010
1 parent 6355636 commit 3379289
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
14 changes: 8 additions & 6 deletions Crypto/Random.hs
Expand Up @@ -8,14 +8,12 @@
This module is for instantiating cryptographically strong determinitic random bit generators (DRBGs, aka PRNGs)
For the simple use case of using the system random number generator ('System.Crypto.Random') to seed the DRBG:
@
g <- newGenIO
@ g <- newGenIO
@
Users needing to provide their own entropy can call 'newGen' directly
@
entropy <- getEntropy nrBytes
@ entropy <- getEntropy nrBytes
let generator = newGen entropy
@
Expand Down Expand Up @@ -84,7 +82,11 @@ class CryptoRandomGen g where
-- additional input @entropy@ in the generation of the requested data to
-- increase the confidence our generated data is a secure random stream.
--
-- Default: @genBytesWithEntropy g bytes entropy = entropy `xor` genBytes g bytes@
-- Default:
--
-- @
-- genBytesWithEntropy g bytes entropy = xor entropy (genBytes g bytes)
-- @
genBytesWithEntropy :: g -> ByteLength -> B.ByteString -> Either GenError (B.ByteString, g)
genBytesWithEntropy g len entropy =
let res = genBytes g len
Expand All @@ -103,7 +105,7 @@ class CryptoRandomGen g where
class SplittableGen g where
split :: g -> (g,g)

-- |Use "System.Crypto.Random" to obtain entropy for newGen.
-- |Use "System.Crypto.Random" to obtain entropy for `newGen`.
newGenIO :: CryptoRandomGen g => IO g
newGenIO = do
let r = undefined
Expand Down
3 changes: 1 addition & 2 deletions System/Crypto/Random.hs
Expand Up @@ -2,8 +2,7 @@
{-|
Maintainer: Thomas.DuBuisson@gmail.com
Stability: beta
Portability: portable
Portability: portable
Obtain entropy from system sources. This module is rather untested on Windows (or testers never provided feedback),
though testing was requested from the community - please e-mail the maintainer with test results.
Expand Down
26 changes: 14 additions & 12 deletions Test/Crypto.hs
@@ -1,22 +1,24 @@
{-# LANGUAGE OverloadedStrings, ExistentialQuantification, ViewPatterns #-}
{-|
Maintainer: Thomas.DuBuisson@gmail.com
Stability: beta
Portability: portable
{- |
Maintainer: Thomas.DuBuisson@gmail.com
Stability: beta
Portability: portable
Basic tests for some common cryptographic algorithms
Most user only need to run the {make,run}Tests functions:
> runTests (makeMD5Tests (undefined :: MD5Digest))
Most user only need to run the {make,run}Tests functions:
@ runTests (makeMD5Tests (undefined :: MD5Digest))
@
or
> runTests =<< makeAESTests (undefined :: AESKey)
@ runTests =<< makeAESTests (undefined :: AESKey)
@
TODO: More KATs are needed - particularly ones for non-AES, SHA, or MD5
algorithms.
-}
-}
module Test.Crypto
(
-- * Test Infrastructure
Expand Down
2 changes: 1 addition & 1 deletion crypto-api.cabal
Expand Up @@ -13,7 +13,7 @@ description: A generic interface for cryptographic operations,
Maintainers of hash and cipher implementations are
encouraged to add instances for the classes defined
in Crypto.Classes. Crypto users are similarly
encoraged to use the interfaces defined in the Classes
encouraged to use the interfaces defined in the Classes
module.

Any concepts or functions of general use to more than
Expand Down

0 comments on commit 3379289

Please sign in to comment.