Skip to content

Commit

Permalink
deploy: a4bb25e
Browse files Browse the repository at this point in the history
  • Loading branch information
zoj613 committed Apr 27, 2024
1 parent 147bf0c commit 5c8a27e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 38 deletions.
19 changes: 1 addition & 18 deletions bitgenerators/Bitgen/ChaCha/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>ChaCha (bitgenerators.Bitgen.ChaCha)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" href="../../../odoc.support/katex.min.css"/><script src="../../../odoc.support/katex.min.js"></script><script>
//<![CDATA[

document.addEventListener("DOMContentLoaded", function () {
var elements = Array.from(document.getElementsByClassName("odoc-katex-math"));
for (var i = 0; i < elements.length; i++) {
var el = elements[i];
var content = el.textContent;
var new_el = document.createElement("span");
new_el.setAttribute("class", "odoc-katex-math-rendered");
var display = el.classList.contains("display");
katex.render(content, new_el, { throwOnError: false, displayMode: display });
el.replaceWith(new_el);
}
});

//]]>
</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">bitgenerators</a> &#x00BB; <a href="../index.html">Bitgen</a> &#x00BB; ChaCha</nav><header class="odoc-preamble"><h1>Module <code><span>Bitgen.ChaCha</span></code></h1><p>ChaCha is a 64-bit PRNG that uses a counter-based design based on the ChaCha cipher. Instances using different values of the key produce sequences. ChaCha has a period of <code class="odoc-katex-math">2^{128}</code> and supports arbitrary advancing and jumping the sequence in increments of <code class="odoc-katex-math">2^{64}</code>. These features allow multiple non-overlapping sequences to be generated.</p><p>The ChaCha state vector consists of a 16-element array of uint32 that capture buffered draws from the distribution, an 8-element array of uint32s holding the seed, and a 2-element array of uint64 that holds the 128-bit counter (<code>low, high</code>). The elements of the seed are the value provided by the user. Typical values for number of rounds are 4, 8, 12, or 20 (for high security).</p><p>ChaCha is seeded using a vector of 4 64-bit unsigned integers. By default this is provided by <a href="../SeedSequence/index.html#val-generate_64bit_state"><code>SeedSequence.generate_64bit_state</code></a>.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p><code>t</code> is the state of the bitgenerator.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_uint64"><a href="#val-next_uint64" class="anchor"></a><code><span><span class="keyword">val</span> next_uint64 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint64 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_uint64 t</code> Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_uint32"><a href="#val-next_uint32" class="anchor"></a><code><span><span class="keyword">val</span> next_uint32 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint32 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_uint32 t</code> Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_bounded_uint64"><a href="#val-next_bounded_uint64" class="anchor"></a><code><span><span class="keyword">val</span> next_bounded_uint64 : <span><span class="xref-unresolved">Stdint</span>.uint64 <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint64 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_bounded_uint64 b t</code> Generates a random unsigned 64-bit integer in the interval <code class="odoc-katex-math">[0, b)</code>. It returns the integer as well as the state of the generator advanced forward. To generate an integer in the range <code class="odoc-katex-math">[a, b)</code>, one should generate an integer in <code class="odoc-katex-math">[0, b - a)</code> using <code>next_bounded_uint64 (b - a) t</code> and then add <code>a</code> to the resulting integer to get the output in the desired range.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_double"><a href="#val-next_double" class="anchor"></a><code><span><span class="keyword">val</span> next_double : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_double t</code> Generates a random 64 bit float and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-initialize"><a href="#val-initialize" class="anchor"></a><code><span><span class="keyword">val</span> initialize : <span><span class="xref-unresolved">Bitgen__.Seed.SeedSequence.t</span> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>initialize s</code> Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence <code>s</code> of <a href="../SeedSequence/index.html#type-t"><code>SeedSequence.t</code></a> type.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-initialize_full"><a href="#val-initialize_full" class="anchor"></a><code><span><span class="keyword">val</span> initialize_full :
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>ChaCha (bitgenerators.Bitgen.ChaCha)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a><a href="../../index.html">bitgenerators</a> &#x00BB; <a href="../index.html">Bitgen</a> &#x00BB; ChaCha</nav><header class="odoc-preamble"><h1>Module <code><span>Bitgen.ChaCha</span></code></h1><p>ChaCha is a 64-bit PRNG that uses a counter-based design based on the ChaCha cipher. Instances using different values of the key produce sequences. ChaCha has a period of <code class="odoc-katex-math">2^{128}</code> and supports arbitrary advancing and jumping the sequence in increments of <code class="odoc-katex-math">2^{64}</code>. These features allow multiple non-overlapping sequences to be generated.</p><p>The ChaCha state vector consists of a 16-element array of uint32 that capture buffered draws from the distribution, an 8-element array of uint32s holding the seed, and a 2-element array of uint64 that holds the 128-bit counter (<code>low, high</code>). The elements of the seed are the value provided by the user. Typical values for number of rounds are 4, 8, 12, or 20 (for high security).</p><p>ChaCha is seeded using a vector of 4 64-bit unsigned integers. By default this is provided by <a href="../SeedSequence/index.html#val-generate_64bit_state"><code>SeedSequence.generate_64bit_state</code></a>.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p><code>t</code> is the state of the bitgenerator.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_uint64"><a href="#val-next_uint64" class="anchor"></a><code><span><span class="keyword">val</span> next_uint64 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint64 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_uint64 t</code> Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_uint32"><a href="#val-next_uint32" class="anchor"></a><code><span><span class="keyword">val</span> next_uint32 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint32 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_uint32 t</code> Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_double"><a href="#val-next_double" class="anchor"></a><code><span><span class="keyword">val</span> next_double : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_double t</code> Generates a random 64 bit float and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-initialize"><a href="#val-initialize" class="anchor"></a><code><span><span class="keyword">val</span> initialize : <span><span class="xref-unresolved">Bitgen__.Seed.SeedSequence.t</span> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>initialize s</code> Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence <code>s</code> of <a href="../SeedSequence/index.html#type-t"><code>SeedSequence.t</code></a> type.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-initialize_full"><a href="#val-initialize_full" class="anchor"></a><code><span><span class="keyword">val</span> initialize_full :
<span><span class="xref-unresolved">Bitgen__.Seed.SeedSequence.t</span> <span class="arrow">&#45;&gt;</span></span>
<span><span>(<span class="xref-unresolved">Stdint</span>.uint64 * <span class="xref-unresolved">Stdint</span>.uint64)</span> <span class="arrow">&#45;&gt;</span></span>
<span>int <span class="arrow">&#45;&gt;</span></span>
Expand Down
2 changes: 1 addition & 1 deletion bitgenerators/Bitgen/Philox64/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
SeedSequence.initialize []
|&gt; SeedSequence.spawn 10
|&gt; fst
|&gt; List.map Philox64.initialize</code></pre></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p><code>t</code> is the state of the bitgenerator.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_uint64"><a href="#val-next_uint64" class="anchor"></a><code><span><span class="keyword">val</span> next_uint64 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint64 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_uint64 t</code> Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_uint32"><a href="#val-next_uint32" class="anchor"></a><code><span><span class="keyword">val</span> next_uint32 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint32 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_uint32 t</code> Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_bounded_uint64"><a href="#val-next_bounded_uint64" class="anchor"></a><code><span><span class="keyword">val</span> next_bounded_uint64 : <span><span class="xref-unresolved">Stdint</span>.uint64 <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint64 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_bounded_uint64 b t</code> Generates a random unsigned 64-bit integer in the interval <code class="odoc-katex-math">[0, b)</code>. It returns the integer as well as the state of the generator advanced forward. To generate an integer in the range <code class="odoc-katex-math">[a, b)</code>, one should generate an integer in <code class="odoc-katex-math">[0, b - a)</code> using <code>next_bounded_uint64 (b - a) t</code> and then add <code>a</code> to the resulting integer to get the output in the desired range.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_double"><a href="#val-next_double" class="anchor"></a><code><span><span class="keyword">val</span> next_double : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_double t</code> Generates a random 64 bit float and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-initialize"><a href="#val-initialize" class="anchor"></a><code><span><span class="keyword">val</span> initialize : <span><span class="xref-unresolved">Bitgen__.Seed.SeedSequence.t</span> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>initialize s</code> Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence <code>s</code> of <a href="../SeedSequence/index.html#type-t"><code>SeedSequence.t</code></a> type.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-initialize_ctr"><a href="#val-initialize_ctr" class="anchor"></a><code><span><span class="keyword">val</span> initialize_ctr :
|&gt; List.map Philox64.initialize</code></pre></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div><div class="spec-doc"><p><code>t</code> is the state of the bitgenerator.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_uint64"><a href="#val-next_uint64" class="anchor"></a><code><span><span class="keyword">val</span> next_uint64 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint64 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_uint64 t</code> Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_uint32"><a href="#val-next_uint32" class="anchor"></a><code><span><span class="keyword">val</span> next_uint32 : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="xref-unresolved">Stdint</span>.uint32 * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_uint32 t</code> Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-next_double"><a href="#val-next_double" class="anchor"></a><code><span><span class="keyword">val</span> next_double : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float * <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>next_double t</code> Generates a random 64 bit float and a state of the generator advanced forward by one step.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-initialize"><a href="#val-initialize" class="anchor"></a><code><span><span class="keyword">val</span> initialize : <span><span class="xref-unresolved">Bitgen__.Seed.SeedSequence.t</span> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>initialize s</code> Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence <code>s</code> of <a href="../SeedSequence/index.html#type-t"><code>SeedSequence.t</code></a> type.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-initialize_ctr"><a href="#val-initialize_ctr" class="anchor"></a><code><span><span class="keyword">val</span> initialize_ctr :
<span><span class="label">counter</span>:<span>(<span class="xref-unresolved">Stdint</span>.uint64 * <span class="xref-unresolved">Stdint</span>.uint64 * <span class="xref-unresolved">Stdint</span>.uint64 * <span class="xref-unresolved">Stdint</span>.uint64)</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="xref-unresolved">Bitgen__.Seed.SeedSequence.t</span> <span class="arrow">&#45;&gt;</span></span>
<a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Get the initial state of the generator using a 4-element unsigned 64-bit tuple as the bitgenerator's <code>counter</code> initial state as well as <a href="../SeedSequence/index.html#type-t"><code>SeedSequence.t</code></a> for the initiale state of the generator's <code>key</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-jump"><a href="#val-jump" class="anchor"></a><code><span><span class="keyword">val</span> jump : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>jump t</code> is equivalent to <code class="odoc-katex-math">2^{128}</code> calls to <a href="#val-next_uint64"><code>Philox64.next_uint64</code></a>.</p></div></div></div></body></html>
Loading

0 comments on commit 5c8a27e

Please sign in to comment.