EMbedded Secure HAshing library. https://docs.shimmering-clarity.net/emsha/
Go to file
Kyle Isom e05aa1295c Documentation updates and prepare for relase. 2023-10-22 02:43:19 -07:00
.circleci Documentation updates and circleCI config update. 2023-10-22 02:32:51 -07:00
.idea Refactor to standard layout. 2023-10-19 20:41:55 -07:00
.trunk Major refactoring effort underway. 2023-10-17 23:43:18 -07:00
cmake Documentation updates and prepare for relase. 2023-10-22 02:43:19 -07:00
debian Miscellaneous packaging fixes. 2016-01-29 16:38:18 -08:00
include/emsha Documentation updates and prepare for relase. 2023-10-22 02:43:19 -07:00
scripts CircleCI work and support Raspbian. 2023-10-18 04:44:37 -07:00
src Refactor to standard layout. 2023-10-19 20:41:55 -07:00
test Refactor to standard layout. 2023-10-19 20:41:55 -07:00
.clang-format Major refactoring effort underway. 2023-10-17 23:43:18 -07:00
.clang-tidy Cut a release. 2023-10-18 03:39:27 -07:00
.gitignore Setting up CircleCI 2023-10-18 04:21:32 -07:00
CHANGELOG Major refactoring effort underway. 2023-10-17 23:43:18 -07:00
CMakeLists.txt Documentation updates and circleCI config update. 2023-10-22 02:32:51 -07:00
LICENSE Initial import. 2015-12-17 01:54:10 -08:00
README.md Documentation updates and prepare for relase. 2023-10-22 02:43:19 -07:00
TODO.rst Add Debian package, finish TODOs. 2016-01-27 21:41:02 -08:00
emsha.pc.in Major refactoring effort underway. 2023-10-17 23:43:18 -07:00

README.md

emsha: EMbedded Secure HAshing

CircleCI

image

This library is an MIT-licensed HMAC-SHA-256 C++11 library designed for embedded systems. It is built following the JPL Power of Ten rules. It was written in response to a need for a standalone HMAC-SHA-256 package that could run on several platforms, including several memory- constrained embedded platforms.

Getting and Building the Source

The source code is available via Git; each version should be git tagged. There is also a mirror on Github.

git clone https://git.wntrmute.dev/sc/emsha

The current release is 1.1.1.

The project is built using CMake. Packages are built using the RelWithDebInfo configuration; artifacts are built using the sc3dev build script.

There are two cache variables that might be useful:

  • SET EMSHA_NO_HEXSTRING disables the provided hexstring function; while this might be useful in many cases, it also adds extra size to the code. For memory-constrained microcontrollers, this might be desirable.
  • SET_EMSHA_NO_HEXLUT disables the larger lookup table used by hexstring, which can save around a kilobyte of program space. If the hexstring function is disabled, this option has no effect.
  • SET_EMSHA_NO_SELFTEST disables the internal self-tests, which can reclaim some additional program space.

Synopsis

The Hash pure virtual class defines a basic interface for programs:

  • Hash::Reset will clear an instance of a Hash class.
  • Hash::Update writes data into the Hash.
  • Hash::Finalize will finish the Hash function and write the results out.

There are two implementations provided for Hash: SHA256 and HMAC.

Documentation

Documentation is currently done with Doxygen; documentation is available online.

See also

Acknowledgements

This library came about after extracting the relevant C code from RFC 6234, and needing a C++ version. It draws heavy inspiration from that code. I also pulled a lot of test vectors from Go's crypto/sha256.