Documentation and build updates in preparation for 1.0.0.

This commit is contained in:
Kyle Isom
2015-12-22 14:31:15 -08:00
parent bfcf11129c
commit 98853d8549
24 changed files with 374 additions and 45 deletions

View File

@@ -16,7 +16,8 @@ libemsha_li_CPPFLAGS = $(AM_CPPFLAGS) -Winline
check_PROGRAMS = emsha_sha256_test emsha_hmac_test \
emsha_core_test emsha_mem_test \
emsha_static_mem_test \
emsha_static_sha_test
emsha_static_sha_test \
emsha_static_hmac_test
check_CPPFLAGS = $(AM_CPPFLAGS) -Wnoinline
# emsha_sha256_test runs through some SHA-256 test vectors, ensuring
@@ -40,22 +41,22 @@ emsha_core_test_LDADD = libemsha.la
emsha_mem_test_SOURCES = test_mem.cc $(TEST_UTILS)
emsha_mem_test_LDADD = libemsha.la
# emsha_static_mem_test is a statically compiled (e.g. not libtool'd)
# test program whose stack can be more accurately measured.
emsha_static_mem_test_SOURCES = test_mem.cc emsha.cc sha256.cc hmac.cc $(TEST_UTILS)
emsha_static_mem_test_CPPFLAGS = $(AM_CPPFLAGS) -static
emsha_static_mem_test_LDFLAGS = $(AM_LDFLAGS) -static
# emsha_static_mem_test is a statically compiled (e.g. not libtool'd)
# test program whose stack can be more accurately measured.
emsha_static_sha_test_SOURCES = test_sha256.cc emsha.cc sha256.cc hmac.cc $(TEST_UTILS)
emsha_static_sha_test_CPPFLAGS = $(AM_CPPFLAGS) -static
emsha_static_sha_test_LDFLAGS = $(AM_LDFLAGS) -static
emsha_static_hmac_test_SOURCES = test_hmac.cc emsha.cc sha256.cc hmac.cc $(TEST_UTILS)
emsha_static_hmac_test_CPPFLAGS = $(AM_CPPFLAGS) -static
emsha_static_hmac_test_LDFLAGS = $(AM_LDFLAGS) -static
.PHONY: valgrind-check
valgrind-check: emsha_static_mem_test
valgrind --tool=massif -v emsha_mem_test ms_print
valgrind --tool=massif -v emsha_static_mem_test ms_print
.PHONY: cloc-report
cloc-report:

View File

@@ -148,6 +148,19 @@ namespace emsha {
// hexstring writes a hex-encoded version of the src byte
// array into dest. The caller *must* ensure that dest is
// srclen * 2 bytes or longer.
//
// Inputs:
//
// dest: a byte array that is 2 * srclen.
//
// src: a byte array containing the data to process.
//
// srclen: the size of src.
//
// Outputs:
//
// The hex-encoded string will be placed into dest.
//
void hexstring(std::uint8_t *dest, std::uint8_t *src, std::uint32_t srclen);
#endif // EMSHA_NO_HEXSTRING
} // end of namespace emsha

View File

@@ -66,6 +66,8 @@ hexstring_test(void)
#endif // #ifndef EMSHA_NO_HEXSTRING
// TODO(kyle): build a test harness around this to verify times between
// runs.
static void
hash_equal_test(void)
{