@@ -28,6 +28,16 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
2828 [ enable_eddsa="detect"]
2929 )
3030
31+ # Add ML-DSA check
32+
33+ AC_ARG_ENABLE ( mldsa ,
34+ AS_HELP_STRING ( [ --enable-mldsa] ,
35+ [ Enable support for ML-DSA (default detect)]
36+ ) ,
37+ [ enable_mldsa="${enableval}"] ,
38+ [ enable_mldsa="detect"]
39+ )
40+
3141 # Second check for the FIPS 140-2 mode
3242
3343 AC_ARG_ENABLE ( fips ,
@@ -100,6 +110,15 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
100110 detect*-no*) enable_eddsa="no";;
101111 esac
102112
113+ case "${enable_mldsa}" in
114+ yes|detect) ACX_OPENSSL_MLDSA;;
115+ esac
116+ case "${enable_mldsa}-${have_lib_openssl_mldsa_support}" in
117+ yes-no) AC_MSG_ERROR ( [ OpenSSL library has no ML-DSA support] ) ;;
118+ detect-yes) enable_mldsa="yes";;
119+ detect-no) enable_mldsa="no";;
120+ esac
121+
103122 case "${enable_gost}-${enable_fips}" in
104123 yes-yes) AC_MSG_ERROR ( [ GOST is not FIPS approved] ) ;;
105124 yes-no|detect-no) ACX_OPENSSL_GOST;;
@@ -166,6 +185,14 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
166185 detect-*) enable_eddsa="${have_lib_botan_eddsa_support}";;
167186 esac
168187
188+ case "${enable_mldsa}" in
189+ yes|detect) ACX_BOTAN_MLDSA;;
190+ esac
191+ case "${enable_mldsa}-${have_lib_botan_mldsa_support}" in
192+ yes-no) AC_MSG_ERROR ( [ Botan library has no ML-DSA support] ) ;;
193+ detect-*) enable_mldsa="${have_lib_botan_mldsa_support}";;
194+ esac
195+
169196 case "${enable_gost}" in
170197 yes|detect) ACX_BOTAN_GOST;;
171198 esac
@@ -231,6 +258,19 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
231258 fi
232259 AM_CONDITIONAL([ WITH_EDDSA] , [ test "x${enable_eddsa}" = "xyes"] )
233260
261+ AC_MSG_CHECKING ( for ML-DSA support )
262+ if test "x${enable_mldsa}" = "xyes"; then
263+ AC_MSG_RESULT ( yes )
264+ AC_DEFINE_UNQUOTED (
265+ [ WITH_ML_DSA] ,
266+ [ ] ,
267+ [ Compile with ML-DSA support]
268+ )
269+ else
270+ AC_MSG_RESULT ( no )
271+ fi
272+ AM_CONDITIONAL([ WITH_ML_DSA] , [ test "x${enable_mldsa}" = "xyes"] )
273+
234274
235275 AC_SUBST ( CRYPTO_INCLUDES )
236276 AC_SUBST ( CRYPTO_LIBS )
0 commit comments