diff --git a/include/internal/libspdm_macro_check.h b/include/internal/libspdm_macro_check.h index b18943d3208..bdc282734f1 100644 --- a/include/internal/libspdm_macro_check.h +++ b/include/internal/libspdm_macro_check.h @@ -1,6 +1,6 @@ /** * Copyright Notice: - * Copyright 2021-2025 DMTF. All rights reserved. + * Copyright 2021-2026 DMTF. All rights reserved. * License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md **/ @@ -22,6 +22,11 @@ ((LIBSPDM_SHA2_SUPPORT) || (LIBSPDM_SHA3_SUPPORT) || \ (LIBSPDM_SM3_SUPPORT)) +#define LIBSPDM_PQC_ASYM_ALGO_SUPPORT \ + ((LIBSPDM_ML_DSA_SUPPORT) || (LIBSPDM_SLH_DSA_SUPPORT)) + +#define LIBSPDM_KEM_ALGO_SUPPORT (LIBSPDM_ML_KEM_SUPPORT) + #if LIBSPDM_FIPS_MODE #define LIBSPDM_FIPS_ASYM_ALGO_SUPPORT \ ((LIBSPDM_RSA_SSA_SUPPORT) || (LIBSPDM_RSA_PSS_SUPPORT) || (LIBSPDM_ECDSA_SUPPORT) || \ @@ -34,22 +39,26 @@ #define LIBSPDM_FIPS_HASH_ALGO_SUPPORT \ ((LIBSPDM_SHA2_SUPPORT) || (LIBSPDM_SHA3_SUPPORT)) + +#define LIBSPDM_FIPS_PQC_ASYM_ALGO_SUPPORT (LIBSPDM_ML_DSA_SUPPORT) + +#define LIBSPDM_FIPS_KEM_ALGO_SUPPORT (LIBSPDM_ML_KEM_SUPPORT) #endif /*LIBSPDM_FIPS_MODE*/ -#if (LIBSPDM_ENABLE_CAPABILITY_KEY_EX_CAP) && !LIBSPDM_ASYM_ALGO_SUPPORT - #error If KEY_EX_CAP is enabled then at least one asymmetric algorithm must also be enabled. +#if (LIBSPDM_ENABLE_CAPABILITY_KEY_EX_CAP) && !(LIBSPDM_ASYM_ALGO_SUPPORT || LIBSPDM_PQC_ASYM_ALGO_SUPPORT) + #error If KEY_EX_CAP is enabled then at least one asymmetric or PQC asymmetric algorithm must also be enabled. #endif -#if (LIBSPDM_ENABLE_CAPABILITY_CERT_CAP) && !LIBSPDM_ASYM_ALGO_SUPPORT - #error If CERT_CAP is enabled then at least one asymmetric algorithm must also be enabled. +#if (LIBSPDM_ENABLE_CAPABILITY_CERT_CAP) && !(LIBSPDM_ASYM_ALGO_SUPPORT || LIBSPDM_PQC_ASYM_ALGO_SUPPORT) + #error If CERT_CAP is enabled then at least one asymmetric or PQC asymmetric algorithm must also be enabled. #endif -#if (LIBSPDM_ENABLE_CAPABILITY_CHAL_CAP) && !LIBSPDM_ASYM_ALGO_SUPPORT - #error If CHAL_CAP is enabled then at least one asymmetric algorithm must also be enabled. +#if (LIBSPDM_ENABLE_CAPABILITY_CHAL_CAP) && !(LIBSPDM_ASYM_ALGO_SUPPORT || LIBSPDM_PQC_ASYM_ALGO_SUPPORT) + #error If CHAL_CAP is enabled then at least one asymmetric or PQC asymmetric algorithm must also be enabled. #endif -#if (LIBSPDM_ENABLE_CAPABILITY_KEY_EX_CAP) && !LIBSPDM_DHE_ALGO_SUPPORT - #error If KEY_EX_CAP is enabled then at least one DHE algorithm must also be enabled. +#if (LIBSPDM_ENABLE_CAPABILITY_KEY_EX_CAP) && !(LIBSPDM_DHE_ALGO_SUPPORT || LIBSPDM_KEM_ALGO_SUPPORT) + #error If KEY_EX_CAP is enabled then at least one DHE or KEM algorithm must also be enabled. #endif #if (LIBSPDM_ENABLE_CAPABILITY_KEY_EX_CAP) && !LIBSPDM_AEAD_ALGO_SUPPORT @@ -110,18 +119,30 @@ #if (LIBSPDM_HASH_ALGO_SUPPORT) && !LIBSPDM_FIPS_HASH_ALGO_SUPPORT #error HASH algo is cleared after FIPS enforcement. #endif + +#if (LIBSPDM_PQC_ASYM_ALGO_SUPPORT) && !LIBSPDM_FIPS_PQC_ASYM_ALGO_SUPPORT + #error PQC ASYM algo is cleared after FIPS enforcement. +#endif + +#if (LIBSPDM_KEM_ALGO_SUPPORT) && !LIBSPDM_FIPS_KEM_ALGO_SUPPORT + #error KEM algo is cleared after FIPS enforcement. +#endif #endif /*LIBSPDM_FIPS_MODE*/ #undef LIBSPDM_ASYM_ALGO_SUPPORT #undef LIBSPDM_DHE_ALGO_SUPPORT #undef LIBSPDM_AEAD_ALGO_SUPPORT #undef LIBSPDM_HASH_ALGO_SUPPORT +#undef LIBSPDM_PQC_ASYM_ALGO_SUPPORT +#undef LIBSPDM_KEM_ALGO_SUPPORT #if LIBSPDM_FIPS_MODE #undef LIBSPDM_FIPS_ASYM_ALGO_SUPPORT #undef LIBSPDM_FIPS_DHE_ALGO_SUPPORT #undef LIBSPDM_FIPS_AEAD_ALGO_SUPPORT #undef LIBSPDM_FIPS_HASH_ALGO_SUPPORT +#undef LIBSPDM_FIPS_PQC_ASYM_ALGO_SUPPORT +#undef LIBSPDM_FIPS_KEM_ALGO_SUPPORT #endif /*LIBSPDM_FIPS_MODE*/ #endif /* LIBSPDM_MACRO_CHECK_H */