@@ -38,6 +38,16 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
3838 [ enable_mldsa="detect"]
3939 )
4040
41+ # Add ML-KEM check
42+
43+ AC_ARG_ENABLE ( mlkem ,
44+ AS_HELP_STRING ( [ --enable-mlkem] ,
45+ [ Enable support for ML-KEM (default detect)]
46+ ) ,
47+ [ enable_mlkem="${enableval}"] ,
48+ [ enable_mlkem="detect"]
49+ )
50+
4151 # Second check for the FIPS 140-2 mode
4252
4353 AC_ARG_ENABLE ( fips ,
@@ -119,6 +129,15 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
119129 detect-no) enable_mldsa="no";;
120130 esac
121131
132+ case "${enable_mlkem}" in
133+ yes|detect) ACX_OPENSSL_MLKEM;;
134+ esac
135+ case "${enable_mlkem}-${have_lib_openssl_mlkem_support}" in
136+ yes-no) AC_MSG_ERROR ( [ OpenSSL library has no ML-KEM support] ) ;;
137+ detect-yes) enable_mlkem="yes";;
138+ detect-no) enable_mlkem="no";;
139+ esac
140+
122141 case "${enable_gost}-${enable_fips}" in
123142 yes-yes) AC_MSG_ERROR ( [ GOST is not FIPS approved] ) ;;
124143 yes-no|detect-no) ACX_OPENSSL_GOST;;
@@ -189,6 +208,10 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
189208 AC_MSG_ERROR ( [ Botan does not support ML-DSA] )
190209 fi
191210
211+ if test "x${enable_mlkem}" = "xyes"; then
212+ AC_MSG_ERROR ( [ Botan does not support ML-KEM] )
213+ fi
214+
192215 case "${enable_gost}" in
193216 yes|detect) ACX_BOTAN_GOST;;
194217 esac
@@ -267,6 +290,19 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
267290 fi
268291 AM_CONDITIONAL([ WITH_ML_DSA] , [ test "x${enable_mldsa}" = "xyes"] )
269292
293+ AC_MSG_CHECKING ( for ML-KEM support )
294+ if test "x${enable_mlkem}" = "xyes"; then
295+ AC_MSG_RESULT ( yes )
296+ AC_DEFINE_UNQUOTED (
297+ [ WITH_ML_KEM] ,
298+ [ ] ,
299+ [ Compile with ML-KEM support]
300+ )
301+ else
302+ AC_MSG_RESULT ( no )
303+ fi
304+ AM_CONDITIONAL([ WITH_ML_KEM] , [ test "x${enable_mlkem}" = "xyes"] )
305+
270306
271307 AC_SUBST ( CRYPTO_INCLUDES )
272308 AC_SUBST ( CRYPTO_LIBS )
0 commit comments