Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LMS, XMSS: move code into wolfCrypt #7500

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 26 additions & 42 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,6 @@ AC_ARG_ENABLE([xmss],
[ ENABLED_XMSS=no ]
)

ENABLED_WC_XMSS=no
philljj marked this conversation as resolved.
Show resolved Hide resolved
for v in `echo $ENABLED_XMSS | tr "," " "`
do
case $v in
Expand All @@ -1238,15 +1237,9 @@ do
no)
;;
verify-only)
XMSS_VERIFY_ONLY=yes
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_XMSS_VERIFY_ONLY -DXMSS_VERIFY_ONLY"
;;
wolfssl)
ENABLED_WC_XMSS=yes
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_XMSS"
;;
small)
ENABLED_WC_XMSS=yes
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_XMSS_SMALL"
;;
*)
Expand All @@ -1255,20 +1248,6 @@ do
esac
done

if test "$ENABLED_XMSS" != "no"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_XMSS"

if test "$ENABLED_WC_XMSS" = "no";
then
# Default is to use hash-sigs XMSS lib. Make sure it's enabled.
if test "$ENABLED_LIBXMSS" = "no"; then
AC_MSG_ERROR([The default implementation for XMSS is the xmss-reference lib.
Please use --with-libxmss.])
fi
fi
fi

# libxmss
# Get the path to xmss-reference.
ENABLED_LIBXMSS="no"
Expand Down Expand Up @@ -1321,14 +1300,26 @@ AC_ARG_WITH([libxmss],
[XMSS_ROOT=""]
)

if test "$ENABLED_XMSS" != "no"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_XMSS"

# Use hash-sigs XMSS lib if enabled.
if test "$ENABLED_LIBXMSS" = "yes"; then
ENABLED_WC_XMSS=no
else
ENABLED_WC_XMSS=yes
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_XMSS"
fi
fi

# LMS
AC_ARG_ENABLE([lms],
[AS_HELP_STRING([--enable-lms],[Enable stateful LMS/HSS signatures (default: disabled)])],
[ ENABLED_LMS=$enableval ],
[ ENABLED_LMS=no ]
)

ENABLED_WC_LMS=no
philljj marked this conversation as resolved.
Show resolved Hide resolved
for v in `echo $ENABLED_LMS | tr "," " "`
do
case $v in
Expand All @@ -1337,37 +1328,17 @@ do
no)
;;
verify-only)
LMS_VERIFY_ONLY=yes
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LMS_VERIFY_ONLY"
;;
small)
ENABLED_WC_LMS=yes
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_LMS_SMALL"
;;
wolfssl)
ENABLED_WC_LMS=yes
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_LMS"
;;
*)
AC_MSG_ERROR([Invalid choice for LMS []: $ENABLED_LMS.])
break;;
esac
done

if test "$ENABLED_LMS" != "no"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_LMS"

if test "$ENABLED_WC_LMS" = "no";
then
# Default is to use hash-sigs LMS lib. Make sure it's enabled.
if test "$ENABLED_LIBLMS" = "no"; then
AC_MSG_ERROR([The default implementation for LMS is the hash-sigs LMS/HSS lib.
Please use --with-liblms.])
fi
fi
fi

# liblms
# Get the path to the hash-sigs LMS HSS lib.
ENABLED_LIBLMS="no"
Expand Down Expand Up @@ -1436,6 +1407,19 @@ AC_ARG_WITH([liblms],
]
)

if test "$ENABLED_LMS" != "no"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_LMS"

# Use hash-sigs LMS lib if enabled.
if test "$ENABLED_LIBLMS" = "yes"; then
ENABLED_WC_LMS=no
else
ENABLED_WC_LMS=yes
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_LMS"
fi
fi

# SINGLE THREADED
AC_ARG_ENABLE([singlethreaded],
[AS_HELP_STRING([--enable-singlethreaded],[Enable wolfSSL single threaded (default: disabled)])],
Expand Down
Loading