@@ -1143,6 +1143,100 @@ then
11431143fi
11441144
11451145
1146+ # XMSS
1147+ AC_ARG_ENABLE ( [ xmss] ,
1148+ [ AS_HELP_STRING ( [ --enable-xmss] ,[ Enable stateful XMSS/XMSS^MT signatures (default: disabled)] ) ] ,
1149+ [ ENABLED_XMSS=$enableval ] ,
1150+ [ ENABLED_XMSS=no ]
1151+ )
1152+
1153+ ENABLED_WC_XMSS=no
1154+ for v in `echo $ENABLED_XMSS | tr "," " "`
1155+ do
1156+ case $v in
1157+ yes)
1158+ ;;
1159+ no)
1160+ ;;
1161+ verify-only)
1162+ XMSS_VERIFY_ONLY=yes
1163+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_XMSS_VERIFY_ONLY -DXMSS_VERIFY_ONLY"
1164+ ;;
1165+ wolfssl)
1166+ ENABLED_WC_XMSS=yes
1167+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_XMSS"
1168+ ;;
1169+ *)
1170+ AC_MSG_ERROR ( [ Invalid choice for XMSS [ ] : $ENABLED_XMSS.] )
1171+ break;;
1172+ esac
1173+ done
1174+
1175+ if test "$ENABLED_XMSS" != "no"
1176+ then
1177+ AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_XMSS"
1178+
1179+ if test "$ENABLED_WC_XMSS" = "no";
1180+ then
1181+ # Default is to use hash-sigs XMSS lib. Make sure it's enabled.
1182+ if test "$ENABLED_LIBXMSS" = "no"; then
1183+ AC_MSG_ERROR ( [ The default implementation for XMSS is the xmss-reference lib.
1184+ Please use --with-libxmss.] )
1185+ fi
1186+ fi
1187+ fi
1188+
1189+ # libxmss
1190+ # Get the path to xmss-reference.
1191+ ENABLED_LIBXMSS="no"
1192+ trylibxmssdir=""
1193+ AC_ARG_WITH ( [ libxmss] ,
1194+ [ AS_HELP_STRING ( [ --with-libxmss=PATH] ,[ PATH to xmss-reference root dir. EXPERIMENTAL!] ) ] ,
1195+ [
1196+ AC_MSG_CHECKING ( [ for libxmss] )
1197+
1198+ trylibxmssdir=$withval
1199+
1200+ if test -e $trylibxmssdir; then
1201+ libxmss_linked=yes
1202+ else
1203+ AC_MSG_ERROR ( [ libxmss isn't found.
1204+ If it's already installed, specify its path using --with-libxmss=/dir/] )
1205+ fi
1206+ if test "$XMSS_VERIFY_ONLY" = "yes"; then
1207+ if test -e $trylibxmssdir/xmss_verify_lib.a; then
1208+ CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBXMSS -I$trylibxmssdir"
1209+ LIB_STATIC_ADD="$LIB_STATIC_ADD $trylibxmssdir/xmss_verify_lib.a"
1210+ enable_shared=no
1211+ enable_static=yes
1212+ libxmss_linked=yes
1213+ else
1214+ AC_MSG_ERROR ( [ xmss_verify_lib.a isn't found.
1215+ If it's already installed, specify its path using --with-libxmss=/dir/] )
1216+ fi
1217+ elif test -e $trylibxmssdir/xmss_lib.a; then
1218+ CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBXMSS -I$trylibxmssdir"
1219+ LIB_STATIC_ADD="$LIB_STATIC_ADD $trylibxmssdir/xmss_lib.a"
1220+ enable_shared=no
1221+ enable_static=yes
1222+ libxmss_linked=yes
1223+ else
1224+ AC_MSG_ERROR ( [ libxmss isn't found.
1225+ If it's already installed, specify its path using --with-libxmss=/dir/] )
1226+ fi
1227+
1228+ XMSS_ROOT=$trylibxmssdir
1229+
1230+ AC_MSG_RESULT ( [ yes] )
1231+ AM_CPPFLAGS="$CPPFLAGS"
1232+
1233+ AM_CFLAGS="$AM_CFLAGS -DHAVE_LIBXMSS -I$trylibxmssdir"
1234+ ENABLED_LIBXMSS="yes"
1235+ AC_SUBST ( [ XMSS_ROOT] )
1236+ ] ,
1237+ [ XMSS_ROOT=""]
1238+ )
1239+
11461240# LMS
11471241AC_ARG_ENABLE ( [ lms] ,
11481242 [ AS_HELP_STRING ( [ --enable-lms] ,[ Enable stateful LMS/HSS signatures (default: disabled)] ) ] ,
@@ -9024,6 +9118,7 @@ AM_CONDITIONAL([BUILD_GE448], [test "x$ENABLED_GE448" = "xyes" || test "x$ENABLE
90249118AM_CONDITIONAL([ BUILD_CURVE448] ,[ test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
90259119AM_CONDITIONAL([ BUILD_CURVE448_SMALL] ,[ test "x$ENABLED_CURVE448_SMALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
90269120AM_CONDITIONAL([ BUILD_WC_LMS] ,[ test "x$ENABLED_WC_LMS" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
9121+ AM_CONDITIONAL([ BUILD_WC_XMSS] ,[ test "x$ENABLED_WC_XMSS" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
90279122AM_CONDITIONAL([ BUILD_WC_KYBER] ,[ test "x$ENABLED_WC_KYBER" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
90289123AM_CONDITIONAL([ BUILD_ECCSI] ,[ test "x$ENABLED_ECCSI" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
90299124AM_CONDITIONAL([ BUILD_SAKKE] ,[ test "x$ENABLED_SAKKE" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
@@ -9064,6 +9159,7 @@ AM_CONDITIONAL([BUILD_CRL_MONITOR],[test "x$ENABLED_CRL_MONITOR" = "xyes"])
90649159AM_CONDITIONAL([ BUILD_USER_RSA] ,[ test "x$ENABLED_USER_RSA" = "xyes"] )
90659160AM_CONDITIONAL([ BUILD_USER_CRYPTO] ,[ test "x$ENABLED_USER_CRYPTO" = "xyes"] )
90669161AM_CONDITIONAL([ BUILD_LIBLMS] ,[ test "x$ENABLED_LIBLMS" = "xyes"] )
9162+ AM_CONDITIONAL([ BUILD_LIBXMSS] ,[ test "x$ENABLED_LIBXMSS" = "xyes"] )
90679163AM_CONDITIONAL([ BUILD_LIBOQS] ,[ test "x$ENABLED_LIBOQS" = "xyes"] )
90689164AM_CONDITIONAL([ BUILD_WNR] ,[ test "x$ENABLED_WNR" = "xyes"] )
90699165AM_CONDITIONAL([ BUILD_SRP] ,[ test "x$ENABLED_SRP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"] )
@@ -9497,6 +9593,11 @@ echo " * ED448: $ENABLED_ED448"
94979593echo " * ED448 streaming: $ENABLED_ED448_STREAM"
94989594echo " * LMS: $ENABLED_LMS"
94999595echo " * LMS wolfSSL impl: $ENABLED_WC_LMS"
9596+ echo " * XMSS: $ENABLED_XMSS"
9597+ echo " * XMSS wolfSSL impl: $ENABLED_WC_XMSS"
9598+ if test "$ENABLED_LIBXMSS" = "yes"; then
9599+ echo " * XMSS_ROOT: $XMSS_ROOT"
9600+ fi
95009601echo " * KYBER: $ENABLED_KYBER"
95019602echo " * KYBER wolfSSL impl: $ENABLED_WC_KYBER"
95029603echo " * ECCSI $ENABLED_ECCSI"
@@ -9552,6 +9653,7 @@ echo " * Persistent session cache: $ENABLED_SAVESESSION"
95529653echo " * Persistent cert cache: $ENABLED_SAVECERT"
95539654echo " * Atomic User Record Layer: $ENABLED_ATOMICUSER"
95549655echo " * Public Key Callbacks: $ENABLED_PKCALLBACKS"
9656+ echo " * libxmss: $ENABLED_LIBXMSS"
95559657echo " * liblms: $ENABLED_LIBLMS"
95569658echo " * liboqs: $ENABLED_LIBOQS"
95579659echo " * Whitewood netRandom: $ENABLED_WNR"
0 commit comments