@@ -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;;
@@ -267,6 +286,19 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
267286 fi
268287 AM_CONDITIONAL([ WITH_ML_DSA] , [ test "x${enable_mldsa}" = "xyes"] )
269288
289+ AC_MSG_CHECKING ( for ML-KEM support )
290+ if test "x${enable_mlkem}" = "xyes"; then
291+ AC_MSG_RESULT ( yes )
292+ AC_DEFINE_UNQUOTED (
293+ [ WITH_ML_KEM] ,
294+ [ ] ,
295+ [ Compile with ML-KEM support]
296+ )
297+ else
298+ AC_MSG_RESULT ( no )
299+ fi
300+ AM_CONDITIONAL([ WITH_ML_KEM] , [ test "x${enable_mlkem}" = "xyes"] )
301+
270302
271303 AC_SUBST ( CRYPTO_INCLUDES )
272304 AC_SUBST ( CRYPTO_LIBS )
0 commit comments