Adds the keyed secure hashing algorithms from FIPS 198-1"
HMAC-SHA1
HMAC-SHA2-224
HMAC-SHA2-256
HMAC-SHA2-384
*HMAC- SHA2-512
HMAC-SHA2-512_224
HMAC-SHA2-512_256
These can all be uses by a user by including #include <gestalt/hmac_sha1.h> or #include <gestalt/hmac_sha2.h>, here is an example of using HMAC-SHA2-256:
Many other SHA implementations use a initupdate and final structure to provide SHA algorithms to users. I did not so this, as my main goal was first to provide a user-friendly interface to SHA for the users. So that naturally led me to just making one function call, not making it necessary to implement SHA as it is in many other libraries. This can be implemented later to provide more flexibility to users and still maintain the separate simple function.
Verification Process
I wrote a new suite of test vectors in tests/sha2Tests.cpp and tests/hmacTests.cpp that test many cases of null inputs, inputs larger than the SHA block size, and inputs larger than the SHA block size. This provides confidence that the algorithms are correct, and if a code change is made in the future then the tests are already present.
Description of the Change
Adds the secure hashing algorithms from FIPS 180-4"
These can all be uses by a user by including
#include <gestalt/sha2.h>
, here is an example of using SHA2-256:Adds the keyed secure hashing algorithms from FIPS 198-1"
These can all be uses by a user by including
#include <gestalt/hmac_sha1.h>
or#include <gestalt/hmac_sha2.h>
, here is an example of using HMAC-SHA2-256:Updates the following documentation:
Adds the following documentation:
Alternate Designs
Many other SHA implementations use a
init
update
andfinal
structure to provide SHA algorithms to users. I did not so this, as my main goal was first to provide a user-friendly interface to SHA for the users. So that naturally led me to just making one function call, not making it necessary to implement SHA as it is in many other libraries. This can be implemented later to provide more flexibility to users and still maintain the separate simple function.Verification Process
I wrote a new suite of test vectors in
tests/sha2Tests.cpp
andtests/hmacTests.cpp
that test many cases of null inputs, inputs larger than the SHA block size, and inputs larger than the SHA block size. This provides confidence that the algorithms are correct, and if a code change is made in the future then the tests are already present.Release Notes