-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A platform independent entropy source
--   
--   A platform independent method to obtain cryptographically strong
--   entropy (RDRAND when available anywhere, urandom on nix, CryptAPI on
--   Windows, patches welcome) Users looking for cryptographically strong
--   (number-theoretically sound) PRNGs should see the <a>DRBG</a> package
--   too.
@package entropy
@version 0.3.8


-- | Obtain entropy from system sources or x86 RDRAND when available.
--   
--   Currently supporting:
--   
--   <ul>
--   <li>Windows via CryptoAPI</li>
--   <li>*nix systems via <tt>/dev/urandom</tt></li>
--   <li>Includes QNX</li>
--   <li>Xen (only when RDRAND is available)</li>
--   </ul>
module System.Entropy

-- | Get a specific number of bytes of cryptographically secure random data
--   using the system-specific facilities.
--   
--   Use RDRAND if available and XOR with '/dev/urandom' on *nix and
--   CryptAPI when on Windows. In short, this entropy is considered
--   cryptographically secure but not true entropy.
getEntropy :: Int -> IO ByteString

-- | Handle for manual resource management
data CryptHandle

-- | Open a <a>CryptHandle</a>
openHandle :: IO CryptHandle

-- | Read random data from a <a>CryptHandle</a>
hGetEntropy :: CryptHandle -> Int -> IO ByteString

-- | Close the <a>CryptHandle</a>
closeHandle :: CryptHandle -> IO ()
