This file is indexed.

/usr/share/doc/libghc-crypto-random-api-doc/html/Crypto-Random-API.html is in libghc-crypto-random-api-doc 0.2.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Crypto.Random.API</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Crypto-Random-API.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Crypto-Random-API.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">crypto-random-api-0.2.0: Simple random generators API for cryptography related code</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>Good</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Maintainer</th><td>Vincent Hanquez &lt;vincent@snarc.org&gt;</td></tr><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Crypto.Random.API</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">System Random generator
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc empty">&nbsp;</div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">class</span>  <a href="#t:CPRG">CPRG</a> g  <span class="keyword">where</span><ul class="subs"><li><a href="#v:cprgNeedReseed">cprgNeedReseed</a> :: g -&gt; <a href="Crypto-Random-API.html#t:ReseedPolicy">ReseedPolicy</a></li><li><a href="#v:cprgSupplyEntropy">cprgSupplyEntropy</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; g -&gt; g</li><li><a href="#v:cprgGenBytes">cprgGenBytes</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -&gt; g -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a>, g)</li></ul></li><li class="src short"><span class="keyword">data</span>  <a href="#t:ReseedPolicy">ReseedPolicy</a> <ul class="subs"><li>= <a href="#v:NeverReseed">NeverReseed</a>  </li><li>| <a href="#v:ReseedInBytes">ReseedInBytes</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Word.html#t:Word64">Word64</a>  </li></ul></li><li class="src short"><a href="#v:genRandomBytes">genRandomBytes</a> :: <a href="Crypto-Random-API.html#t:CPRG">CPRG</a> g =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -&gt; g -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a>, g)</li><li class="src short"><a href="#v:genRandomBytes-39-">genRandomBytes'</a> :: <a href="Crypto-Random-API.html#t:CPRG">CPRG</a> g =&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -&gt; g -&gt; ([<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a>], g)</li><li class="src short"><a href="#v:withRandomBytes">withRandomBytes</a> :: <a href="Crypto-Random-API.html#t:CPRG">CPRG</a> g =&gt; g -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; a) -&gt; (a, g)</li><li class="src short"><a href="#v:getSystemEntropy">getSystemEntropy</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:SystemRandom">SystemRandom</a> </li><li class="src short"><a href="#v:getSystemRandomGen">getSystemRandomGen</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> <a href="Crypto-Random-API.html#t:SystemRandom">SystemRandom</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">class</span>  <a name="t:CPRG" class="def">CPRG</a> g  <span class="keyword">where</span><a href="src/Crypto-Random-API.html#CPRG" class="link">Source</a></p><div class="doc"><p>A class of Cryptographic Secure Random generator.
</p><p>The main difference with the generic haskell RNG is that
 it return bytes instead of integer.
</p><p>It is quite similar to the CryptoRandomGen class in crypto-api
 except that error are not returned to the user. Instead
 the user is suppose to handle reseeding by using the NeedReseed
 and SupplyEntropy methods. For other type of errors, the user
 is expected to generate bytes with the parameters bounds explicity
 defined here.
</p><p>The CPRG need to be able to generate up to 2^20 bytes in one call,
</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:cprgNeedReseed" class="def">cprgNeedReseed</a> :: g -&gt; <a href="Crypto-Random-API.html#t:ReseedPolicy">ReseedPolicy</a><a href="src/Crypto-Random-API.html#cprgNeedReseed" class="link">Source</a></p><div class="doc"><p>Provide a way to query the CPRG to calculate when new entropy
 is required to be supplied so the CPRG doesn't repeat output, and
 break assumptions. This returns the number of bytes before
 which supply entropy should have been called.
</p></div><p class="src"><a name="v:cprgSupplyEntropy" class="def">cprgSupplyEntropy</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; g -&gt; g<a href="src/Crypto-Random-API.html#cprgSupplyEntropy" class="link">Source</a></p><div class="doc"><p>Supply entropy to the CPRG, that can be used now or later
 to reseed the CPRG. This should be used in conjunction to
 NeedReseed to know when to supply entropy.
</p></div><p class="src"><a name="v:cprgGenBytes" class="def">cprgGenBytes</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -&gt; g -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a>, g)<a href="src/Crypto-Random-API.html#cprgGenBytes" class="link">Source</a></p><div class="doc"><p>Generate bytes using the CPRG and the number specified.
</p><p>For user of the API, it's recommended to use genRandomBytes
 instead of this method directly. the CPRG need to be able
 to supply at minimum 2^20 bytes at a time.
</p></div></div><div class="subs instances"><p id="control.i:CPRG" class="caption collapser" onclick="toggleSection('i:CPRG')">Instances</p><div id="section.i:CPRG" class="show"><table><tr><td class="src"><a href="Crypto-Random-API.html#t:CPRG">CPRG</a> <a href="Crypto-Random-API.html#t:SystemRandom">SystemRandom</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:ReseedPolicy" class="def">ReseedPolicy</a>  <a href="src/Crypto-Random-API.html#ReseedPolicy" class="link">Source</a></p><div class="doc"><p>This is the reseed policy requested by the CPRG
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:NeverReseed" class="def">NeverReseed</a></td><td class="doc"><p>there is no need to reseed as either
 the RG doesn't supports it, it's done automatically
 or pratically the reseeding period exceed a Word64 type.
</p></td></tr><tr><td class="src"><a name="v:ReseedInBytes" class="def">ReseedInBytes</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Word.html#t:Word64">Word64</a></td><td class="doc"><p>the RG need to be reseed in the number
 of bytes joined to the type. it should be done before
 the number reached 0, otherwise an user of the RG
 might request too many bytes and get repeated random bytes.
</p></td></tr></table></div><div class="subs instances"><p id="control.i:ReseedPolicy" class="caption collapser" onclick="toggleSection('i:ReseedPolicy')">Instances</p><div id="section.i:ReseedPolicy" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Crypto-Random-API.html#t:ReseedPolicy">ReseedPolicy</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Crypto-Random-API.html#t:ReseedPolicy">ReseedPolicy</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:genRandomBytes" class="def">genRandomBytes</a><a href="src/Crypto-Random-API.html#genRandomBytes" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Crypto-Random-API.html#t:CPRG">CPRG</a> g</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a></td><td class="doc"><p>number of bytes to return
</p></td></tr><tr><td class="src">-&gt; g</td><td class="doc"><p>CPRG to use
</p></td></tr><tr><td class="src">-&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a>, g)</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Generate bytes using the cprg in parameter.
</p><p>If the number of bytes requested is really high,
 it's preferable to use <code><a href="Crypto-Random-API.html#v:genRandomBytes">genRandomBytes</a></code> for better memory efficiency.
</p></div></div><div class="top"><p class="src"><a name="v:genRandomBytes-39-" class="def">genRandomBytes'</a><a href="src/Crypto-Random-API.html#genRandomBytes%27" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Crypto-Random-API.html#t:CPRG">CPRG</a> g</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a></td><td class="doc"><p>number of bytes to return
</p></td></tr><tr><td class="src">-&gt; g</td><td class="doc"><p>CPRG to use
</p></td></tr><tr><td class="src">-&gt; ([<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a>], g)</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Generate bytes using the cprg in parameter.
</p><p>This is not tail recursive and an excessive len (&gt;= 2^29) parameter would
 result in stack overflow.
</p></div></div><div class="top"><p class="src"><a name="v:withRandomBytes" class="def">withRandomBytes</a> :: <a href="Crypto-Random-API.html#t:CPRG">CPRG</a> g =&gt; g -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -&gt; (<a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; a) -&gt; (a, g)<a href="src/Crypto-Random-API.html#withRandomBytes" class="link">Source</a></p><div class="doc"><p>this is equivalent to using Control.Arrow <code>first</code> with <code><a href="Crypto-Random-API.html#v:genRandomBytes">genRandomBytes</a></code>.
</p><p>namely it generate <code>len bytes and map the bytes to the function </code>f
</p></div></div><div class="top"><p class="src"><a name="v:getSystemEntropy" class="def">getSystemEntropy</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a><a href="src/Crypto-Random-API.html#getSystemEntropy" class="link">Source</a></p><div class="doc"><p>Return system entropy using the entropy package <code>getEntropy</code>
</p></div></div><h1 id="g:1">System Random generator
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:SystemRandom" class="def">SystemRandom</a>  <a href="src/Crypto-Random-API.html#SystemRandom" class="link">Source</a></p><div class="doc"><p>This is a simple generator that pull bytes from the system entropy
 directly. Its randomness and security properties are absolutely
 depends on the underlaying system implementation.
</p></div><div class="subs instances"><p id="control.i:SystemRandom" class="caption collapser" onclick="toggleSection('i:SystemRandom')">Instances</p><div id="section.i:SystemRandom" class="show"><table><tr><td class="src"><a href="Crypto-Random-API.html#t:CPRG">CPRG</a> <a href="Crypto-Random-API.html#t:SystemRandom">SystemRandom</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:getSystemRandomGen" class="def">getSystemRandomGen</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> <a href="Crypto-Random-API.html#t:SystemRandom">SystemRandom</a><a href="src/Crypto-Random-API.html#getSystemRandomGen" class="link">Source</a></p><div class="doc"><p>Get a random number generator based on the standard system entropy source
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>