Permalink
Browse files

add edown-generated docs

  • Loading branch information...
1 parent 844f8c5 commit 79e2564c81ee94718711d48516aac3cab7794c35 @vinoski committed Mar 13, 2013
Showing with 312 additions and 1 deletion.
  1. +0 −1 .gitignore
  2. +12 −0 doc/README.md
  3. +3 −0 doc/edoc-info
  4. +204 −0 doc/erlsha2.md
  5. +93 −0 doc/hmac.md
View
@@ -2,7 +2,6 @@
.eunit
c_src/config.h
c_src/*.o
-doc
ebin
priv
deps
View
@@ -0,0 +1,12 @@
+
+
+#The erlsha2 application#
+
+
+##Modules##
+
+
+<table width="100%" border="0" summary="list of modules">
+<tr><td><a href="http://github.com/vinoski/erlsha2/blob/master/doc/erlsha2.md" class="module">erlsha2</a></td></tr>
+<tr><td><a href="http://github.com/vinoski/erlsha2/blob/master/doc/hmac.md" class="module">hmac</a></td></tr></table>
+
View
@@ -0,0 +1,3 @@
+{application,erlsha2}.
+{packages,[]}.
+{modules,[erlsha2,hmac]}.
View
@@ -0,0 +1,204 @@
+
+
+#Module erlsha2#
+* [Description](#description)
+* [Function Index](#index)
+* [Function Details](#functions)
+
+
+Implementations of SHA-224, SHA-256, SHA-384, SHA-512 in Erlang NIFs.
+
+Copyright (c) 2009-2011 Stephen B. Vinoski, All rights reserved. Open source, BSD License
+
+__Version:__ 2.0
+
+
+__Introduced in:__ 03 Jan 2009
+
+
+__Authors:__ Steve Vinoski ([`vinoski@ieee.org`](mailto:vinoski@ieee.org)) (_web site:_ [`http://steve.vinoski.net/`](http://steve.vinoski.net/)).
+
+__References__* See [
+the Secure Hash Standard](http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf) and the [Wikipedia SHA1
+article](http://en.wikipedia.org/wiki/SHA1). Find the code [here](http://github.com/vinoski/erlsha2).
+<a name="index"></a>
+
+##Function Index##
+
+
+<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#sha224-1">sha224/1</a></td><td>Returns a SHA-224 hexadecimal digest.</td></tr><tr><td valign="top"><a href="#sha224_final-1">sha224_final/1</a></td><td>Finishes the update of a SHA-224 Context and returns the computed
+message digest.</td></tr><tr><td valign="top"><a href="#sha224_init-0">sha224_init/0</a></td><td>Creates a SHA-224 context to be in subsequent calls to
+sha224_update/2.</td></tr><tr><td valign="top"><a href="#sha224_update-2">sha224_update/2</a></td><td>Updates a SHA-224 context with message data and returns a new
+context.</td></tr><tr><td valign="top"><a href="#sha256-1">sha256/1</a></td><td>Returns a SHA-256 hexadecimal digest.</td></tr><tr><td valign="top"><a href="#sha256_final-1">sha256_final/1</a></td><td>Finishes the update of a SHA-256 Context and returns the computed
+message digest.</td></tr><tr><td valign="top"><a href="#sha256_init-0">sha256_init/0</a></td><td>Creates a SHA-256 context to be in subsequent calls to
+sha256_update/2.</td></tr><tr><td valign="top"><a href="#sha256_update-2">sha256_update/2</a></td><td>Updates a SHA-256 context with message data and returns a new
+context.</td></tr><tr><td valign="top"><a href="#sha384-1">sha384/1</a></td><td>Returns a SHA-384 hexadecimal digest.</td></tr><tr><td valign="top"><a href="#sha384_final-1">sha384_final/1</a></td><td>Finishes the update of a SHA-384 Context and returns the computed
+message digest.</td></tr><tr><td valign="top"><a href="#sha384_init-0">sha384_init/0</a></td><td>Creates a SHA-384 context to be in subsequent calls to
+sha384_update/2.</td></tr><tr><td valign="top"><a href="#sha384_update-2">sha384_update/2</a></td><td>Updates a SHA-384 context with message data and returns a new
+context.</td></tr><tr><td valign="top"><a href="#sha512-1">sha512/1</a></td><td>Returns a SHA-512 hexadecimal digest.</td></tr><tr><td valign="top"><a href="#sha512_final-1">sha512_final/1</a></td><td>Finishes the update of a SHA-512 Context and returns the computed
+message digest.</td></tr><tr><td valign="top"><a href="#sha512_init-0">sha512_init/0</a></td><td>Creates a SHA-512 context to be in subsequent calls to
+sha512_update/2.</td></tr><tr><td valign="top"><a href="#sha512_update-2">sha512_update/2</a></td><td>Updates a SHA-512 context with message data and returns a new
+context.</td></tr></table>
+
+
+<a name="functions"></a>
+
+##Function Details##
+
+<a name="sha224-1"></a>
+
+###sha224/1##
+
+
+<pre>sha224(M :: <a href="#type-message">message()</a>) -> <a href="#type-digest">digest()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-message"&gt;message()&lt;/a&gt; = binary() | iolist()</pre></li><li><pre>&lt;a name="type-digest"&gt;digest()&lt;/a&gt; = binary()</pre></li></ul>
+
+Returns a SHA-224 hexadecimal digest.
+<a name="sha224_final-1"></a>
+
+###sha224_final/1##
+
+
+<pre>sha224_final(Context :: <a href="#type-context">context()</a>) -> <a href="#type-digest">digest()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li><li><pre>&lt;a name="type-digest"&gt;digest()&lt;/a&gt; = binary()</pre></li></ul>
+
+Finishes the update of a SHA-224 Context and returns the computed
+message digest.
+<a name="sha224_init-0"></a>
+
+###sha224_init/0##
+
+
+<pre>sha224_init() -> <a href="#type-context">context()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li></ul>
+
+Creates a SHA-224 context to be in subsequent calls to
+sha224_update/2.
+<a name="sha224_update-2"></a>
+
+###sha224_update/2##
+
+
+<pre>sha224_update(Context :: <a href="#type-context">context()</a>, M :: <a href="#type-message">message()</a>) -><a href="#type-newcontext">newcontext()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-message"&gt;message()&lt;/a&gt; = binary() | iolist()</pre></li><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li><li><pre>&lt;a name="type-newcontext"&gt;newcontext()&lt;/a&gt; = binary()</pre></li></ul>
+
+Updates a SHA-224 context with message data and returns a new
+context.
+<a name="sha256-1"></a>
+
+###sha256/1##
+
+
+<pre>sha256(M :: <a href="#type-message">message()</a>) -> <a href="#type-digest">digest()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-message"&gt;message()&lt;/a&gt; = binary() | iolist()</pre></li><li><pre>&lt;a name="type-digest"&gt;digest()&lt;/a&gt; = binary()</pre></li></ul>
+
+Returns a SHA-256 hexadecimal digest.
+<a name="sha256_final-1"></a>
+
+###sha256_final/1##
+
+
+<pre>sha256_final(Context :: <a href="#type-context">context()</a>) -> <a href="#type-digest">digest()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li><li><pre>&lt;a name="type-digest"&gt;digest()&lt;/a&gt; = binary()</pre></li></ul>
+
+Finishes the update of a SHA-256 Context and returns the computed
+message digest.
+<a name="sha256_init-0"></a>
+
+###sha256_init/0##
+
+
+<pre>sha256_init() -> <a href="#type-context">context()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li></ul>
+
+Creates a SHA-256 context to be in subsequent calls to
+sha256_update/2.
+<a name="sha256_update-2"></a>
+
+###sha256_update/2##
+
+
+<pre>sha256_update(Context :: <a href="#type-context">context()</a>, M :: <a href="#type-message">message()</a>) -><a href="#type-newcontext">newcontext()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-message"&gt;message()&lt;/a&gt; = binary() | iolist()</pre></li><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li><li><pre>&lt;a name="type-newcontext"&gt;newcontext()&lt;/a&gt; = binary()</pre></li></ul>
+
+Updates a SHA-256 context with message data and returns a new
+context.
+<a name="sha384-1"></a>
+
+###sha384/1##
+
+
+<pre>sha384(M :: <a href="#type-message">message()</a>) -> <a href="#type-digest">digest()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-message"&gt;message()&lt;/a&gt; = binary() | iolist()</pre></li><li><pre>&lt;a name="type-digest"&gt;digest()&lt;/a&gt; = binary()</pre></li></ul>
+
+Returns a SHA-384 hexadecimal digest.
+If the argument is a binary, the result is a binary, otherwise the
+<a name="sha384_final-1"></a>
+
+###sha384_final/1##
+
+
+<pre>sha384_final(Context :: <a href="#type-context">context()</a>) -> <a href="#type-digest">digest()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li><li><pre>&lt;a name="type-digest"&gt;digest()&lt;/a&gt; = binary()</pre></li></ul>
+
+Finishes the update of a SHA-384 Context and returns the computed
+message digest.
+<a name="sha384_init-0"></a>
+
+###sha384_init/0##
+
+
+<pre>sha384_init() -> <a href="#type-context">context()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li></ul>
+
+Creates a SHA-384 context to be in subsequent calls to
+sha384_update/2.
+<a name="sha384_update-2"></a>
+
+###sha384_update/2##
+
+
+<pre>sha384_update(Context :: <a href="#type-context">context()</a>, M :: <a href="#type-message">message()</a>) -><a href="#type-newcontext">newcontext()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-message"&gt;message()&lt;/a&gt; = binary() | iolist()</pre></li><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li><li><pre>&lt;a name="type-newcontext"&gt;newcontext()&lt;/a&gt; = binary()</pre></li></ul>
+
+Updates a SHA-384 context with message data and returns a new
+context.
+<a name="sha512-1"></a>
+
+###sha512/1##
+
+
+<pre>sha512(M :: <a href="#type-message">message()</a>) -> <a href="#type-digest">digest()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-message"&gt;message()&lt;/a&gt; = binary() | iolist()</pre></li><li><pre>&lt;a name="type-digest"&gt;digest()&lt;/a&gt; = binary()</pre></li></ul>
+
+Returns a SHA-512 hexadecimal digest.
+<a name="sha512_final-1"></a>
+
+###sha512_final/1##
+
+
+<pre>sha512_final(Context :: <a href="#type-context">context()</a>) -> <a href="#type-digest">digest()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li><li><pre>&lt;a name="type-digest"&gt;digest()&lt;/a&gt; = binary()</pre></li></ul>
+
+Finishes the update of a SHA-512 Context and returns the computed
+message digest.
+<a name="sha512_init-0"></a>
+
+###sha512_init/0##
+
+
+<pre>sha512_init() -> <a href="#type-context">context()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li></ul>
+
+Creates a SHA-512 context to be in subsequent calls to
+sha512_update/2.
+<a name="sha512_update-2"></a>
+
+###sha512_update/2##
+
+
+<pre>sha512_update(Context :: <a href="#type-context">context()</a>, M :: <a href="#type-message">message()</a>) -><a href="#type-newcontext">newcontext()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-message"&gt;message()&lt;/a&gt; = binary() | iolist()</pre></li><li><pre>&lt;a name="type-context"&gt;context()&lt;/a&gt; = binary()</pre></li><li><pre>&lt;a name="type-newcontext"&gt;newcontext()&lt;/a&gt; = binary()</pre></li></ul>
+
+Updates a SHA-512 context with message data and returns a new
+context.
View
@@ -0,0 +1,93 @@
+
+
+#Module hmac#
+* [Description](#description)
+* [Function Index](#index)
+* [Function Details](#functions)
+
+
+HMAC wrappers for erlsha2.
+
+__Authors:__ Jared Flatow, Steve Vinoski.
+
+__References__* Based on the
+[
+mailing list response
+](http://erlang.org/pipermail/erlang-questions/2011-May/058174.md)
+by Steve Davis.
+<a name="index"></a>
+
+##Function Index##
+
+
+<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#hexlify-1">hexlify/1</a></td><td>Convert binary to equivalent hexadecimal string.</td></tr><tr><td valign="top"><a href="#hmac-2">hmac/2</a></td><td>Compute a SHA MAC message authentication code from key and data.</td></tr><tr><td valign="top"><a href="#hmac-4">hmac/4</a></td><td>Compute a SHA MAC message authentication code from key and data using
+the specified hash function and blocksize.</td></tr><tr><td valign="top"><a href="#hmac224-2">hmac224/2</a></td><td>Compute a SHA-224 MAC message authentication code from key and data.</td></tr><tr><td valign="top"><a href="#hmac256-2">hmac256/2</a></td><td>Compute a SHA-256 MAC message authentication code from key and data.</td></tr><tr><td valign="top"><a href="#hmac384-2">hmac384/2</a></td><td>Compute a SHA-384 MAC message authentication code from key and data.</td></tr><tr><td valign="top"><a href="#hmac512-2">hmac512/2</a></td><td>Compute a SHA-512 MAC message authentication code from key and data.</td></tr></table>
+
+
+<a name="functions"></a>
+
+##Function Details##
+
+<a name="hexlify-1"></a>
+
+###hexlify/1##
+
+
+<pre>hexlify(Binary :: binary()) -&gt; list()</pre>
+
+Convert binary to equivalent hexadecimal string.
+<a name="hmac-2"></a>
+
+###hmac/2##
+
+
+<pre>hmac(Key :: <a href="#type-key">key()</a>, Data :: <a href="#type-data">data()</a>) -> <a href="#type-mac">mac()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-key"&gt;key()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-data"&gt;data()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-mac"&gt;mac()&lt;/a&gt; = binary()</pre></li></ul>
+
+Compute a SHA MAC message authentication code from key and data.
+<a name="hmac-4"></a>
+
+###hmac/4##
+
+
+<pre>hmac(Key :: <a href="#type-key">key()</a>,Data :: <a href="#type-data">data()</a>,Hash :: <a href="#type-hash">hash()</a>,Blocksize :: <a href="#type-blocksize">blocksize()</a>) -><a href="#type-mac">mac()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-key"&gt;key()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-data"&gt;data()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-hash"&gt;hash()&lt;/a&gt; = fun((binary()) -&gt; binary())</pre></li><li><pre>&lt;a name="type-blocksize"&gt;blocksize()&lt;/a&gt; = non_neg_integer()</pre></li><li><pre>&lt;a name="type-mac"&gt;mac()&lt;/a&gt; = binary()</pre></li></ul>
+
+Compute a SHA MAC message authentication code from key and data using
+the specified hash function and blocksize.
+<a name="hmac224-2"></a>
+
+###hmac224/2##
+
+
+<pre>hmac224(Key :: <a href="#type-key">key()</a>, Data :: <a href="#type-data">data()</a>) -> <a href="#type-mac">mac()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-key"&gt;key()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-data"&gt;data()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-mac"&gt;mac()&lt;/a&gt; = binary()</pre></li></ul>
+
+Compute a SHA-224 MAC message authentication code from key and data.
+<a name="hmac256-2"></a>
+
+###hmac256/2##
+
+
+<pre>hmac256(Key :: <a href="#type-key">key()</a>, Data :: <a href="#type-data">data()</a>) -> <a href="#type-mac">mac()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-key"&gt;key()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-data"&gt;data()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-mac"&gt;mac()&lt;/a&gt; = binary()</pre></li></ul>
+
+Compute a SHA-256 MAC message authentication code from key and data.
+<a name="hmac384-2"></a>
+
+###hmac384/2##
+
+
+<pre>hmac384(Key :: <a href="#type-key">key()</a>, Data :: <a href="#type-data">data()</a>) -> <a href="#type-mac">mac()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-key"&gt;key()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-data"&gt;data()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-mac"&gt;mac()&lt;/a&gt; = binary()</pre></li></ul>
+
+Compute a SHA-384 MAC message authentication code from key and data.
+<a name="hmac512-2"></a>
+
+###hmac512/2##
+
+
+<pre>hmac512(Key :: <a href="#type-key">key()</a>, Data :: <a href="#type-data">data()</a>) -> <a href="#type-mac">mac()</a></pre>
+<ul class="definitions"><li><pre>&lt;a name="type-key"&gt;key()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-data"&gt;data()&lt;/a&gt; = iolist() | binary()</pre></li><li><pre>&lt;a name="type-mac"&gt;mac()&lt;/a&gt; = binary()</pre></li></ul>
+
+Compute a SHA-512 MAC message authentication code from key and data.

0 comments on commit 79e2564

Please sign in to comment.