@@ -1144,6 +1144,109 @@ then
11441144fi
11451145
11461146
1147+ # liblms
1148+ # Get the path to the hash-sigs LMS HSS lib.
1149+ ENABLED_LIBLMS="no"
1150+ tryliblmsdir=""
1151+ AC_ARG_WITH ( [ liblms] ,
1152+ [ AS_HELP_STRING ( [ --with-liblms=PATH] ,[ PATH to hash-sigs LMS/HSS install (default /usr/local) EXPERIMENTAL!] ) ] ,
1153+ [
1154+ AC_MSG_CHECKING ( [ for liblms] )
1155+
1156+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [ #include <hss.h>] ] , [ [ param_set_t lm_type; param_set_t lm_ots_type; hss_get_public_key_len(4, &lm_type, &lm_ots_type); ] ] ) ] , [ liblms_linked=yes ] ,[ liblms_linked=no ] )
1157+
1158+ if test "x$liblms_linked" = "xno" ; then
1159+ if test "x$withval" != "xno" ; then
1160+ tryliblmsdir=$withval
1161+ fi
1162+ if test "x$withval" = "xyes" ; then
1163+ tryliblmsdir="/usr/local"
1164+ fi
1165+
1166+ # 1. By default use the hash-sigs single-threaded static library.
1167+ # 2. If 1 not found, then use the multi-threaded static lib.
1168+ # 3. If 2 not found, then use the multi-threaded dynamic lib.
1169+ if test -e $tryliblmsdir/hss_lib.a; then
1170+ CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
1171+ LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib.a"
1172+ enable_shared=no
1173+ enable_static=yes
1174+ liblms_linked=yes
1175+ elif test -e $tryliblmsdir/hss_lib_thread.a; then
1176+ CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
1177+ LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib_thread.a"
1178+ enable_shared=no
1179+ enable_static=yes
1180+ liblms_linked=yes
1181+ elif test -e $tryliblmsdir/lib/libhss.so; then
1182+ LIBS="$LIBS -lhss"
1183+ CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir/include/hss"
1184+ LDFLAGS="$AM_LDFLAGS $LDFLAGS -L$tryliblmsdir/lib"
1185+
1186+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [ #include <hss.h>] ] , [ [ param_set_t lm_type; param_set_t lm_ots_type; hss_get_public_key_len(4, &lm_type, &lm_ots_type); ] ] ) ] , [ liblms_linked=yes ] ,[ liblms_linked=no ] )
1187+ else
1188+ AC_MSG_ERROR ( [ liblms isn't found.
1189+ If it's already installed, specify its path using --with-liblms=/dir/] )
1190+ fi
1191+
1192+ if test "x$liblms_linked" = "xno" ; then
1193+ AC_MSG_ERROR ( [ liblms isn't found.
1194+ If it's already installed, specify its path using --with-liblms=/dir/] )
1195+ fi
1196+
1197+ AC_MSG_RESULT ( [ yes] )
1198+ AM_CPPFLAGS="$CPPFLAGS"
1199+ AM_LDFLAGS="$LDFLAGS"
1200+ else
1201+ AC_MSG_RESULT ( [ yes] )
1202+ fi
1203+
1204+ AM_CFLAGS="$AM_CFLAGS -DHAVE_LIBLMS"
1205+ ENABLED_LIBLMS="yes"
1206+ ]
1207+ )
1208+
1209+
1210+ # LMS
1211+ AC_ARG_ENABLE ( [ lms] ,
1212+ [ AS_HELP_STRING ( [ --enable-lms] ,[ Enable stateful LMS/HSS signatures (default: disabled)] ) ] ,
1213+ [ ENABLED_LMS=$enableval ] ,
1214+ [ ENABLED_LMS=no ]
1215+ )
1216+
1217+ ENABLED_WC_LMS=no
1218+ for v in `echo $ENABLED_LMS | tr "," " "`
1219+ do
1220+ case $v in
1221+ yes)
1222+ ;;
1223+ no)
1224+ ;;
1225+ wolfssl)
1226+ ENABLED_WC_LMS=yes
1227+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_LMS"
1228+ ;;
1229+ *)
1230+ AC_MSG_ERROR ( [ Invalid choice for LMS [ ] : $ENABLED_LMS.] )
1231+ break;;
1232+ esac
1233+ done
1234+
1235+ if test "$ENABLED_LMS" != "no"
1236+ then
1237+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_LMS"
1238+
1239+ if test "$ENABLED_WC_LMS" = "no";
1240+ then
1241+ # Default is to use hash-sigs LMS lib. Make sure it's enabled.
1242+ if test "$ENABLED_LIBLMS" = "no"; then
1243+ AC_MSG_ERROR ( [ The default implementation for LMS is the hash-sigs LMS/HSS lib.
1244+ Please use --with-liblms.] )
1245+ fi
1246+ fi
1247+ fi
1248+
1249+
11471250# SINGLE THREADED
11481251AC_ARG_ENABLE ( [ singlethreaded] ,
11491252 [ AS_HELP_STRING ( [ --enable-singlethreaded] ,[ Enable wolfSSL single threaded (default: disabled)] ) ] ,
@@ -8753,6 +8856,7 @@ AM_CONDITIONAL([BUILD_FE448], [test "x$ENABLED_FE448" = "xyes" || test "x$ENABLE
87538856AM_CONDITIONAL([ BUILD_GE448] , [ test "x$ENABLED_GE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
87548857AM_CONDITIONAL([ BUILD_CURVE448] ,[ test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
87558858AM_CONDITIONAL([ BUILD_CURVE448_SMALL] ,[ test "x$ENABLED_CURVE448_SMALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
8859+ AM_CONDITIONAL([ BUILD_WC_LMS] ,[ test "x$ENABLED_WC_LMS" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
87568860AM_CONDITIONAL([ BUILD_WC_KYBER] ,[ test "x$ENABLED_WC_KYBER" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
87578861AM_CONDITIONAL([ BUILD_ECCSI] ,[ test "x$ENABLED_ECCSI" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
87588862AM_CONDITIONAL([ BUILD_SAKKE] ,[ test "x$ENABLED_SAKKE" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
@@ -8792,6 +8896,7 @@ AM_CONDITIONAL([BUILD_CRL],[test "x$ENABLED_CRL" != "xno" || test "x$ENABLED_USE
87928896AM_CONDITIONAL([ BUILD_CRL_MONITOR] ,[ test "x$ENABLED_CRL_MONITOR" = "xyes"] )
87938897AM_CONDITIONAL([ BUILD_USER_RSA] ,[ test "x$ENABLED_USER_RSA" = "xyes"] )
87948898AM_CONDITIONAL([ BUILD_USER_CRYPTO] ,[ test "x$ENABLED_USER_CRYPTO" = "xyes"] )
8899+ AM_CONDITIONAL([ BUILD_LIBLMS] ,[ test "x$ENABLED_LIBLMS" = "xyes"] )
87958900AM_CONDITIONAL([ BUILD_LIBOQS] ,[ test "x$ENABLED_LIBOQS" = "xyes"] )
87968901AM_CONDITIONAL([ BUILD_WNR] ,[ test "x$ENABLED_WNR" = "xyes"] )
87978902AM_CONDITIONAL([ BUILD_SRP] ,[ test "x$ENABLED_SRP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
@@ -9242,6 +9347,8 @@ echo " * ED25519 streaming: $ENABLED_ED25519_STREAM"
92429347echo " * CURVE448: $ENABLED_CURVE448"
92439348echo " * ED448: $ENABLED_ED448"
92449349echo " * ED448 streaming: $ENABLED_ED448_STREAM"
9350+ echo " * LMS: $ENABLED_LMS"
9351+ echo " * LMS wolfSSL impl: $ENABLED_WC_LMS"
92459352echo " * KYBER: $ENABLED_KYBER"
92469353echo " * KYBER wolfSSL impl: $ENABLED_WC_KYBER"
92479354echo " * ECCSI $ENABLED_ECCSI"
@@ -9297,6 +9404,7 @@ echo " * Persistent session cache: $ENABLED_SAVESESSION"
92979404echo " * Persistent cert cache: $ENABLED_SAVECERT"
92989405echo " * Atomic User Record Layer: $ENABLED_ATOMICUSER"
92999406echo " * Public Key Callbacks: $ENABLED_PKCALLBACKS"
9407+ echo " * liblms: $ENABLED_LIBLMS"
93009408echo " * liboqs: $ENABLED_LIBOQS"
93019409echo " * Whitewood netRandom: $ENABLED_WNR"
93029410echo " * Server Name Indication: $ENABLED_SNI"
0 commit comments