Skip to content

Commit d7c3a17

Browse files
committed
LMS cleanup.
1 parent 55bbd58 commit d7c3a17

3 files changed

Lines changed: 32 additions & 11 deletions

File tree

INSTALL

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,21 @@ We also have vcpkg ports for wolftpm, wolfmqtt and curl.
261261
your system. At present we support the current master branch of
262262
the hash-sigs project.
263263

264-
At present the hash-sigs project only builds static libraries.
265-
It can be modified though to build and install a shared library
266-
in /usr/local.
264+
Currently the hash-sigs project only builds static libraries:
265+
- hss_lib.a: a single-threaded static lib.
266+
- hss_lib_thread.a: a multi-threaded static lib.
267+
268+
The multi-threaded version will mainly have speedups for key
269+
generation and signing.
270+
271+
Additionally, the hash-sigs project can be modified to build
272+
and install a shared library in /usr/local with either single
273+
or multi-threaded versions. If the shared version has been
274+
built, libhss.so is the assumed name.
267275

268276
wolfSSL supports either option, and by default will look for
269-
hss_lib_thread.a in a specified hash-sigs dir. If hash-sigs has
270-
been built as a shared lib and installed in /usr/local/ , then
271-
wolfSSL will look for libhss.so there.
277+
hss_lib.a first, and hss_lib_thread.a second, and libhss.so
278+
lastly, in a specified hash-sigs dir.
272279

273280
How to get and build the hash-sigs library:
274281
$ mkdir ~/hash_sigs
@@ -279,10 +286,15 @@ We also have vcpkg ports for wolftpm, wolfmqtt and curl.
279286
In sha256.h, set USE_OPENSSL to 0:
280287
#define USE_OPENSSL 0
281288

282-
Now build:
283-
$ make
289+
To build the single-threaded version:
290+
$ make hss_lib.a
291+
$ ls *.a
292+
hss_lib.a
293+
294+
To build multi-threaded:
295+
$ make hss_lib_thread.a
284296
$ ls *.a
285-
hss_lib.a hss_lib_thread.a hss_verify.a
297+
hss_lib_thread.a
286298

287299
Build wolfSSL with
288300
$ ./configure \

configure.ac

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,16 @@ AC_ARG_WITH([liblms],
11601160
tryliblmsdir="/usr/local"
11611161
fi
11621162
1163-
if test -e $tryliblmsdir/hss_lib_thread.a; then
1163+
# 1. By default use the hash-sigs single-threaded static library.
1164+
# 2. If 1 not found, then use the multi-threaded static lib.
1165+
# 3. If 2 not found, then use the multi-threaded dynamic lib.
1166+
if test -e $tryliblmsdir/hss_lib.a; then
1167+
CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
1168+
LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib.a"
1169+
enable_shared=no
1170+
enable_static=yes
1171+
liblms_linked=yes
1172+
elif test -e $tryliblmsdir/hss_lib_thread.a; then
11641173
CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
11651174
LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib_thread.a"
11661175
enable_shared=no

wolfcrypt/src/ext_lms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ int wc_LmsKey_MakeKey(LmsKey* key, WC_RNG * rng)
401401

402402
LmsRng = rng;
403403

404-
/* todo: The has-sigs lib allows you to save variable length auxiliary
404+
/* TODO: The hash-sigs lib allows you to save variable length auxiliary
405405
* data, which can be used to speed up key reloading when signing. The
406406
* aux data can be 300B - 1KB in size.
407407
*

0 commit comments

Comments
 (0)