LMS cleanup.

This commit is contained in:
jordan
2023-07-10 23:43:07 -05:00
parent 55bbd5865c
commit d7c3a176e2
3 changed files with 32 additions and 11 deletions

30
INSTALL
View File

@ -261,14 +261,21 @@ We also have vcpkg ports for wolftpm, wolfmqtt and curl.
your system. At present we support the current master branch of your system. At present we support the current master branch of
the hash-sigs project. the hash-sigs project.
At present the hash-sigs project only builds static libraries. Currently the hash-sigs project only builds static libraries:
It can be modified though to build and install a shared library - hss_lib.a: a single-threaded static lib.
in /usr/local. - hss_lib_thread.a: a multi-threaded static lib.
The multi-threaded version will mainly have speedups for key
generation and signing.
Additionally, the hash-sigs project can be modified to build
and install a shared library in /usr/local with either single
or multi-threaded versions. If the shared version has been
built, libhss.so is the assumed name.
wolfSSL supports either option, and by default will look for wolfSSL supports either option, and by default will look for
hss_lib_thread.a in a specified hash-sigs dir. If hash-sigs has hss_lib.a first, and hss_lib_thread.a second, and libhss.so
been built as a shared lib and installed in /usr/local/ , then lastly, in a specified hash-sigs dir.
wolfSSL will look for libhss.so there.
How to get and build the hash-sigs library: How to get and build the hash-sigs library:
$ mkdir ~/hash_sigs $ mkdir ~/hash_sigs
@ -279,10 +286,15 @@ We also have vcpkg ports for wolftpm, wolfmqtt and curl.
In sha256.h, set USE_OPENSSL to 0: In sha256.h, set USE_OPENSSL to 0:
#define USE_OPENSSL 0 #define USE_OPENSSL 0
Now build: To build the single-threaded version:
$ make $ make hss_lib.a
$ ls *.a $ ls *.a
hss_lib.a hss_lib_thread.a hss_verify.a hss_lib.a
To build multi-threaded:
$ make hss_lib_thread.a
$ ls *.a
hss_lib_thread.a
Build wolfSSL with Build wolfSSL with
$ ./configure \ $ ./configure \

View File

@ -1160,7 +1160,16 @@ AC_ARG_WITH([liblms],
tryliblmsdir="/usr/local" tryliblmsdir="/usr/local"
fi fi
if test -e $tryliblmsdir/hss_lib_thread.a; then # 1. By default use the hash-sigs single-threaded static library.
# 2. If 1 not found, then use the multi-threaded static lib.
# 3. If 2 not found, then use the multi-threaded dynamic lib.
if test -e $tryliblmsdir/hss_lib.a; then
CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib.a"
enable_shared=no
enable_static=yes
liblms_linked=yes
elif test -e $tryliblmsdir/hss_lib_thread.a; then
CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir" CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib_thread.a" LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib_thread.a"
enable_shared=no enable_shared=no

View File

@ -401,7 +401,7 @@ int wc_LmsKey_MakeKey(LmsKey* key, WC_RNG * rng)
LmsRng = rng; LmsRng = rng;
/* todo: The has-sigs lib allows you to save variable length auxiliary /* TODO: The hash-sigs lib allows you to save variable length auxiliary
* data, which can be used to speed up key reloading when signing. The * data, which can be used to speed up key reloading when signing. The
* aux data can be 300B - 1KB in size. * aux data can be 300B - 1KB in size.
* *