@@ -1141,6 +1141,100 @@ then
11411141fi
11421142
11431143
1144+ # liblms
1145+ # Get the path to the hash-sigs LMS HSS lib.
1146+ ENABLED_LIBLMS="no"
1147+ tryliblmsdir=""
1148+ AC_ARG_WITH ( [ liblms] ,
1149+ [ AS_HELP_STRING ( [ --with-liblms=PATH] ,[ PATH to hash-sigs LMS/HSS install (default /usr/local) EXPERIMENTAL!] ) ] ,
1150+ [
1151+ AC_MSG_CHECKING ( [ for liblms] )
1152+
1153+ 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 ] )
1154+
1155+ if test "x$liblms_linked" = "xno" ; then
1156+ if test "x$withval" != "xno" ; then
1157+ tryliblmsdir=$withval
1158+ fi
1159+ if test "x$withval" = "xyes" ; then
1160+ tryliblmsdir="/usr/local"
1161+ fi
1162+
1163+ if test -e $tryliblmsdir/hss_lib_thread.a; then
1164+ CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
1165+ LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib_thread.a"
1166+ enable_shared=no
1167+ enable_static=yes
1168+ liblms_linked=yes
1169+ elif test -e $tryliblmsdir/lib/libhss.so; then
1170+ LIBS="$LIBS -lhss"
1171+ CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir/include/hss"
1172+ LDFLAGS="$AM_LDFLAGS $LDFLAGS -L$tryliblmsdir/lib"
1173+
1174+ 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 ] )
1175+ else
1176+ AC_MSG_ERROR ( [ liblms isn't found.
1177+ If it's already installed, specify its path using --with-liblms=/dir/] )
1178+ fi
1179+
1180+ if test "x$liblms_linked" = "xno" ; then
1181+ AC_MSG_ERROR ( [ liblms isn't found.
1182+ If it's already installed, specify its path using --with-liblms=/dir/] )
1183+ fi
1184+
1185+ AC_MSG_RESULT ( [ yes] )
1186+ AM_CPPFLAGS="$CPPFLAGS"
1187+ AM_LDFLAGS="$LDFLAGS"
1188+ else
1189+ AC_MSG_RESULT ( [ yes] )
1190+ fi
1191+
1192+ AM_CFLAGS="$AM_CFLAGS -DHAVE_LIBLMS"
1193+ ENABLED_LIBLMS="yes"
1194+ ]
1195+ )
1196+
1197+
1198+ # LMS
1199+ AC_ARG_ENABLE ( [ lms] ,
1200+ [ AS_HELP_STRING ( [ --enable-lms] ,[ Enable stateful LMS/HSS signatures (default: disabled)] ) ] ,
1201+ [ ENABLED_LMS=$enableval ] ,
1202+ [ ENABLED_LMS=no ]
1203+ )
1204+
1205+ ENABLED_WC_LMS=no
1206+ for v in `echo $ENABLED_LMS | tr "," " "`
1207+ do
1208+ case $v in
1209+ yes)
1210+ ;;
1211+ no)
1212+ ;;
1213+ wolfssl)
1214+ ENABLED_WC_LMS=yes
1215+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_LMS"
1216+ ;;
1217+ *)
1218+ AC_MSG_ERROR ( [ Invalid choice for LMS [ ] : $ENABLED_LMS.] )
1219+ break;;
1220+ esac
1221+ done
1222+
1223+ if test "$ENABLED_LMS" != "no"
1224+ then
1225+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_LMS"
1226+
1227+ if test "$ENABLED_WC_LMS" = "no";
1228+ then
1229+ # Default is to use hash-sigs LMS lib. Make sure it's enabled.
1230+ if test "$ENABLED_LIBLMS" = "no"; then
1231+ AC_MSG_ERROR ( [ The default implementation for LMS is the hash-sigs LMS/HSS lib.
1232+ Please use --with-liblms.] )
1233+ fi
1234+ fi
1235+ fi
1236+
1237+
11441238# SINGLE THREADED
11451239AC_ARG_ENABLE ( [ singlethreaded] ,
11461240 [ AS_HELP_STRING ( [ --enable-singlethreaded] ,[ Enable wolfSSL single threaded (default: disabled)] ) ] ,
@@ -8665,6 +8759,7 @@ AM_CONDITIONAL([BUILD_FE448], [test "x$ENABLED_FE448" = "xyes" || test "x$ENABLE
86658759AM_CONDITIONAL([ BUILD_GE448] , [ test "x$ENABLED_GE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
86668760AM_CONDITIONAL([ BUILD_CURVE448] ,[ test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
86678761AM_CONDITIONAL([ BUILD_CURVE448_SMALL] ,[ test "x$ENABLED_CURVE448_SMALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
8762+ AM_CONDITIONAL([ BUILD_WC_LMS] ,[ test "x$ENABLED_WC_LMS" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
86688763AM_CONDITIONAL([ BUILD_WC_KYBER] ,[ test "x$ENABLED_WC_KYBER" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
86698764AM_CONDITIONAL([ BUILD_ECCSI] ,[ test "x$ENABLED_ECCSI" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
86708765AM_CONDITIONAL([ BUILD_SAKKE] ,[ test "x$ENABLED_SAKKE" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
@@ -8704,6 +8799,7 @@ AM_CONDITIONAL([BUILD_CRL],[test "x$ENABLED_CRL" != "xno" || test "x$ENABLED_USE
87048799AM_CONDITIONAL([ BUILD_CRL_MONITOR] ,[ test "x$ENABLED_CRL_MONITOR" = "xyes"] )
87058800AM_CONDITIONAL([ BUILD_USER_RSA] ,[ test "x$ENABLED_USER_RSA" = "xyes"] )
87068801AM_CONDITIONAL([ BUILD_USER_CRYPTO] ,[ test "x$ENABLED_USER_CRYPTO" = "xyes"] )
8802+ AM_CONDITIONAL([ BUILD_LIBLMS] ,[ test "x$ENABLED_LIBLMS" = "xyes"] )
87078803AM_CONDITIONAL([ BUILD_LIBOQS] ,[ test "x$ENABLED_LIBOQS" = "xyes"] )
87088804AM_CONDITIONAL([ BUILD_WNR] ,[ test "x$ENABLED_WNR" = "xyes"] )
87098805AM_CONDITIONAL([ BUILD_SRP] ,[ test "x$ENABLED_SRP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
@@ -9150,6 +9246,8 @@ echo " * ED25519 streaming: $ENABLED_ED25519_STREAM"
91509246echo " * CURVE448: $ENABLED_CURVE448"
91519247echo " * ED448: $ENABLED_ED448"
91529248echo " * ED448 streaming: $ENABLED_ED448_STREAM"
9249+ echo " * LMS: $ENABLED_LMS"
9250+ echo " * LMS wolfSSL impl: $ENABLED_WC_LMS"
91539251echo " * KYBER: $ENABLED_KYBER"
91549252echo " * KYBER wolfSSL impl: $ENABLED_WC_KYBER"
91559253echo " * ECCSI $ENABLED_ECCSI"
@@ -9204,6 +9302,7 @@ echo " * Persistent session cache: $ENABLED_SAVESESSION"
92049302echo " * Persistent cert cache: $ENABLED_SAVECERT"
92059303echo " * Atomic User Record Layer: $ENABLED_ATOMICUSER"
92069304echo " * Public Key Callbacks: $ENABLED_PKCALLBACKS"
9305+ echo " * liblms: $ENABLED_LIBLMS"
92079306echo " * liboqs: $ENABLED_LIBOQS"
92089307echo " * Whitewood netRandom: $ENABLED_WNR"
92099308echo " * Server Name Indication: $ENABLED_SNI"
0 commit comments