Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (32 sloc) 1.784 kb
475111d Steve Vinoski revamp the original pure Erlang implementation
authored
1 # SHA-224, SHA-256, SHA-384, SHA-512 implemented in Erlang NIFs.
2
3 ## Description
4
c4b4bd8 Steve Vinoski fix previous commit: add hmac doc and remove rebar
authored
5 The **erlsha2** library application implements the SHA-2 Secure Hash
6 Standard (SHA-224, SHA-256, SHA-384, SHA-512) using Erlang NIFs. (It
7 also provides pure Erlang implementations, though they are much slower
8 than the C NIF implementations.) It also includes HMAC wrappers for
9 the SHA-2 functions.
475111d Steve Vinoski revamp the original pure Erlang implementation
authored
10
11 See the following links for details:
12
4b1203b Steve Vinoski fix URL typos
authored
13 * [Secure Hash Standard (PDF)](http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf)
14 * [Wikipedia SHA1 article](http://en.wikipedia.org/wiki/SHA1)
475111d Steve Vinoski revamp the original pure Erlang implementation
authored
15
16 The code implemented here was written by simply following the
17 algorithm descriptions provided in the standard. Provided functions
18 follow the same style as those found in the standard Erlang `crypto`
19 module: for each hash variant there's a simple function returning a
20 binary digest and a set of three functions for initializing a digest
21 context, updating the context with additional data to be hashed, and
22 finalizing the context to get a binary digest result.
23
b7bd0fe Steve Vinoski add more README info
authored
24 This implementation replaces and obsoletes the
25 [original pure Erlang implementation](http://steve.vinoski.net/code/sha2.erl).
26
475111d Steve Vinoski revamp the original pure Erlang implementation
authored
27 ## Building and Installing
28
29 The **erlsha2** app is built with
b7bd0fe Steve Vinoski add more README info
authored
30 [rebar](https://github.com/basho/rebar), which must be in the command
31 `PATH`.
32
33 I don't use Windows at all so I doubt it builds there. I don't know of
34 any reason it shouldn't work there, though; you'll just have to build
35 it manually. If nothing else, you could comment out the `on_load`
36 directive in the Erlang file to prevent it from loading the NIF
37 implementation, thereby gaining access to the pure Erlang
38 implementation instead, but note that it's much slower than the C
39 code.
475111d Steve Vinoski revamp the original pure Erlang implementation
authored
40
41 ### Erlang Version
42
43 The **erlsha2** app requires Erlang R14B or later.
Something went wrong with that request. Please try again.