Skip to content
SHA-224, SHA-256, SHA-384, SHA-512 implemented in Erlang NIFs.
Erlang C Other
Latest commit e3434b3 Jun 20, 2015 @essen essen Use sh instead of bash in config.sh
As far as I can tell there's no need to use bash explicitly.

This change allows systems without bash installed to compile
the project.
Failed to load latest commit information.
c_src Use sh instead of bash in config.sh Jun 20, 2015
doc ARMv7l (RPi Model-B) CFLAGS do not support -m32 flag May 25, 2015
priv update edown usage and generated docs May 24, 2014
src ARMv7l (RPi Model-B) CFLAGS do not support -m32 flag May 25, 2015
test replace hmac:hexlify with a NIF May 24, 2014
.gitignore Add .d files to .gitignore Jan 27, 2015
AUTHORS revamp the original pure Erlang implementation Feb 19, 2011
LICENSE Update to version 2.2. Jan 27, 2015
Makefile
README.md fix rebar deprecation warnings Mar 12, 2012
edown.config use new edown_make script to generate documentation Oct 3, 2011
rebar.config ARMv7l (RPi Model-B) CFLAGS do not support -m32 flag May 25, 2015
rebar.config.script update edown usage and generated docs May 24, 2014

README.md

SHA-224, SHA-256, SHA-384, SHA-512 implemented in Erlang NIFs.

Description

The erlsha2 library application implements the SHA-2 Secure Hash Standard (SHA-224, SHA-256, SHA-384, SHA-512) using Erlang NIFs. (It also provides pure Erlang implementations, though they are much slower than the C NIF implementations.) It also includes HMAC wrappers for the SHA-2 functions.

See the following links for details:

The code implemented here was written by simply following the algorithm descriptions provided in the standard. Provided functions follow the same style as those found in the standard Erlang crypto module: for each hash variant there's a simple function returning a binary digest and a set of three functions for initializing a digest context, updating the context with additional data to be hashed, and finalizing the context to get a binary digest result.

This implementation replaces and obsoletes the original pure Erlang implementation.

Building and Installing

The erlsha2 app is built with rebar, which must be in the command PATH.

I don't use Windows at all so I doubt it builds there. I don't know of any reason it shouldn't work there, though; you'll just have to build it manually. If nothing else, you could comment out the on_load directive in the Erlang file to prevent it from loading the NIF implementation, thereby gaining access to the pure Erlang implementation instead, but note that it's much slower than the C code.

If you run into any build trouble, first make sure the version of rebar you're using is reasonably up to date.

Erlang Version

The erlsha2 app requires Erlang R14B or later.

Something went wrong with that request. Please try again.