-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
121 changed files
with
1,362 additions
and
522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ed25519 (mirage-crypto-ec.Mirage_crypto_ec.Ed25519)</title><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.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">mirage-crypto-ec</a> » <a href="../index.html">Mirage_crypto_ec</a> » Ed25519</nav><header class="odoc-preamble"><h1>Module <code><span>Mirage_crypto_ec.Ed25519</span></code></h1><p>Curve 25519 DSA, also known as Ed25519.</p></header><nav class="odoc-toc"><ul><li><a href="#serialisation">Serialisation</a></li><li><a href="#deriving-the-public-key">Deriving the public key</a></li><li><a href="#key-generation">Key generation</a></li><li><a href="#cryptographic-operations">Cryptographic operations</a></li></ul></nav><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-priv"><a href="#type-priv" class="anchor"></a><code><span><span class="keyword">type</span> priv</span></code></div><div class="spec-doc"><p>The type for private keys.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-pub"><a href="#type-pub" class="anchor"></a><code><span><span class="keyword">type</span> pub</span></code></div><div class="spec-doc"><p>The type for public keys.</p></div></div><h3 id="serialisation"><a href="#serialisation" class="anchor"></a>Serialisation</h3><div class="odoc-spec"><div class="spec value anchored" id="val-priv_of_cstruct"><a href="#val-priv_of_cstruct" class="anchor"></a><code><span><span class="keyword">val</span> priv_of_cstruct : <span><span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> <span><span>(<a href="#type-priv">priv</a>, <a href="../index.html#type-error">error</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p><code>priv_of_cstruct cs</code> decodes a private key from the buffer <code>cs</code>. If the provided data is invalid, an error is returned.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-priv_to_cstruct"><a href="#val-priv_to_cstruct" class="anchor"></a><code><span><span class="keyword">val</span> priv_to_cstruct : <span><a href="#type-priv">priv</a> <span class="arrow">-></span></span> <span class="xref-unresolved">Cstruct</span>.t</span></code></div><div class="spec-doc"><p><code>priv_to_cstruct p</code> encode the private key <code>p</code> to a buffer.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pub_of_cstruct"><a href="#val-pub_of_cstruct" class="anchor"></a><code><span><span class="keyword">val</span> pub_of_cstruct : <span><span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> <span><span>(<a href="#type-pub">pub</a>, <a href="../index.html#type-error">error</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p><code>pub_of_cstruct cs</code> decodes a public key from the buffer <code>cs</code>. If the provided data is invalid, an error is returned.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pub_to_cstruct"><a href="#val-pub_to_cstruct" class="anchor"></a><code><span><span class="keyword">val</span> pub_to_cstruct : <span><a href="#type-pub">pub</a> <span class="arrow">-></span></span> <span class="xref-unresolved">Cstruct</span>.t</span></code></div><div class="spec-doc"><p><code>pub_to_cstruct p</code> encodes the public key <code>p</code> into a buffer.</p></div></div><h3 id="deriving-the-public-key"><a href="#deriving-the-public-key" class="anchor"></a>Deriving the public key</h3><div class="odoc-spec"><div class="spec value anchored" id="val-pub_of_priv"><a href="#val-pub_of_priv" class="anchor"></a><code><span><span class="keyword">val</span> pub_of_priv : <span><a href="#type-priv">priv</a> <span class="arrow">-></span></span> <a href="#type-pub">pub</a></span></code></div><div class="spec-doc"><p><code>pub_of_priv p</code> extracts the public key from the private key <code>p</code>.</p></div></div><h3 id="key-generation"><a href="#key-generation" class="anchor"></a>Key generation</h3><div class="odoc-spec"><div class="spec value anchored" id="val-generate"><a href="#val-generate" class="anchor"></a><code><span><span class="keyword">val</span> generate : <span>?g:<a href="../../../mirage-crypto-rng/Mirage_crypto_rng/index.html#type-g">Mirage_crypto_rng.g</a> <span class="arrow">-></span></span> <span>unit <span class="arrow">-></span></span> <a href="#type-priv">priv</a> * <a href="#type-pub">pub</a></span></code></div><div class="spec-doc"><p><code>generate ~g ()</code> generates a key pair.</p></div></div><h3 id="cryptographic-operations"><a href="#cryptographic-operations" class="anchor"></a>Cryptographic operations</h3><div class="odoc-spec"><div class="spec value anchored" id="val-sign"><a href="#val-sign" class="anchor"></a><code><span><span class="keyword">val</span> sign : <span>key:<a href="#type-priv">priv</a> <span class="arrow">-></span></span> <span><span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> <span class="xref-unresolved">Cstruct</span>.t</span></code></div><div class="spec-doc"><p><code>sign ~key msg</code> signs the message <code>msg</code> using the private <code>key</code>. The result is the concatenation of <code>r</code> and <code>s</code>, as specified in RFC 8032.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-verify"><a href="#val-verify" class="anchor"></a><code><span><span class="keyword">val</span> verify : <span>key:<a href="#type-pub">pub</a> <span class="arrow">-></span></span> <span><span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> <span>msg:<span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> bool</span></code></div><div class="spec-doc"><p><code>verify ~key signature msg</code> verifies the <code>signature</code> on the message <code>msg</code> with the public <code>key</code>. The return value is <code>true</code> if verification was successful, <code>false</code> otherwise.</p></div></div></div></body></html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ed25519 (mirage-crypto-ec.Mirage_crypto_ec.Ed25519)</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">mirage-crypto-ec</a> » <a href="../index.html">Mirage_crypto_ec</a> » Ed25519</nav><header class="odoc-preamble"><h1>Module <code><span>Mirage_crypto_ec.Ed25519</span></code></h1><p>Curve 25519 DSA, also known as Ed25519.</p></header><nav class="odoc-toc"><ul><li><a href="#serialisation">Serialisation</a></li><li><a href="#deriving-the-public-key">Deriving the public key</a></li><li><a href="#key-generation">Key generation</a></li><li><a href="#cryptographic-operations">Cryptographic operations</a></li></ul></nav><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-priv"><a href="#type-priv" class="anchor"></a><code><span><span class="keyword">type</span> priv</span></code></div><div class="spec-doc"><p>The type for private keys.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-pub"><a href="#type-pub" class="anchor"></a><code><span><span class="keyword">type</span> pub</span></code></div><div class="spec-doc"><p>The type for public keys.</p></div></div><h3 id="serialisation"><a href="#serialisation" class="anchor"></a>Serialisation</h3><div class="odoc-spec"><div class="spec value anchored" id="val-priv_of_cstruct"><a href="#val-priv_of_cstruct" class="anchor"></a><code><span><span class="keyword">val</span> priv_of_cstruct : <span><span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> <span><span>(<a href="#type-priv">priv</a>, <a href="../index.html#type-error">error</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p><code>priv_of_cstruct cs</code> decodes a private key from the buffer <code>cs</code>. If the provided data is invalid, an error is returned.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-priv_to_cstruct"><a href="#val-priv_to_cstruct" class="anchor"></a><code><span><span class="keyword">val</span> priv_to_cstruct : <span><a href="#type-priv">priv</a> <span class="arrow">-></span></span> <span class="xref-unresolved">Cstruct</span>.t</span></code></div><div class="spec-doc"><p><code>priv_to_cstruct p</code> encode the private key <code>p</code> to a buffer.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pub_of_cstruct"><a href="#val-pub_of_cstruct" class="anchor"></a><code><span><span class="keyword">val</span> pub_of_cstruct : <span><span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> <span><span>(<a href="#type-pub">pub</a>, <a href="../index.html#type-error">error</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p><code>pub_of_cstruct cs</code> decodes a public key from the buffer <code>cs</code>. If the provided data is invalid, an error is returned.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pub_to_cstruct"><a href="#val-pub_to_cstruct" class="anchor"></a><code><span><span class="keyword">val</span> pub_to_cstruct : <span><a href="#type-pub">pub</a> <span class="arrow">-></span></span> <span class="xref-unresolved">Cstruct</span>.t</span></code></div><div class="spec-doc"><p><code>pub_to_cstruct p</code> encodes the public key <code>p</code> into a buffer.</p></div></div><h3 id="deriving-the-public-key"><a href="#deriving-the-public-key" class="anchor"></a>Deriving the public key</h3><div class="odoc-spec"><div class="spec value anchored" id="val-pub_of_priv"><a href="#val-pub_of_priv" class="anchor"></a><code><span><span class="keyword">val</span> pub_of_priv : <span><a href="#type-priv">priv</a> <span class="arrow">-></span></span> <a href="#type-pub">pub</a></span></code></div><div class="spec-doc"><p><code>pub_of_priv p</code> extracts the public key from the private key <code>p</code>.</p></div></div><h3 id="key-generation"><a href="#key-generation" class="anchor"></a>Key generation</h3><div class="odoc-spec"><div class="spec value anchored" id="val-generate"><a href="#val-generate" class="anchor"></a><code><span><span class="keyword">val</span> generate : <span><span class="optlabel">?g</span>:<a href="../../../mirage-crypto-rng/Mirage_crypto_rng/index.html#type-g">Mirage_crypto_rng.g</a> <span class="arrow">-></span></span> <span>unit <span class="arrow">-></span></span> <a href="#type-priv">priv</a> * <a href="#type-pub">pub</a></span></code></div><div class="spec-doc"><p><code>generate ~g ()</code> generates a key pair.</p></div></div><h3 id="cryptographic-operations"><a href="#cryptographic-operations" class="anchor"></a>Cryptographic operations</h3><div class="odoc-spec"><div class="spec value anchored" id="val-sign"><a href="#val-sign" class="anchor"></a><code><span><span class="keyword">val</span> sign : <span><span class="label">key</span>:<a href="#type-priv">priv</a> <span class="arrow">-></span></span> <span><span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> <span class="xref-unresolved">Cstruct</span>.t</span></code></div><div class="spec-doc"><p><code>sign ~key msg</code> signs the message <code>msg</code> using the private <code>key</code>. The result is the concatenation of <code>r</code> and <code>s</code>, as specified in RFC 8032.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-verify"><a href="#val-verify" class="anchor"></a><code><span><span class="keyword">val</span> verify : <span><span class="label">key</span>:<a href="#type-pub">pub</a> <span class="arrow">-></span></span> <span><span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> <span><span class="label">msg</span>:<span class="xref-unresolved">Cstruct</span>.t <span class="arrow">-></span></span> bool</span></code></div><div class="spec-doc"><p><code>verify ~key signature msg</code> verifies the <code>signature</code> on the message <code>msg</code> with the public <code>key</code>. The return value is <code>true</code> if verification was successful, <code>false</code> otherwise.</p></div></div></div></body></html> |
Oops, something went wrong.