From d61de193eaf5f3c232b496f56f61d9d3a5f5fdb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Sz=C3=A9pk=C3=BAti?= Date: Wed, 13 May 2026 16:58:52 +0200 Subject: [PATCH] Allow macros that shadow mldsa-native functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit check_names.py normally requires uppercase macro names. Make an exception for helper macros that shadow the functions names used by mldsa-native. Signed-off-by: Bence Szépkúti --- scripts/check_names.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/check_names.py b/scripts/check_names.py index 9bc8ebc9e..8c1fb7fb1 100755 --- a/scripts/check_names.py +++ b/scripts/check_names.py @@ -61,7 +61,12 @@ # implementation), must not end with an underscore (for legibility), # and must not consist of a single letter (because we've seen embedded # platforms that claim single-uppercase-letter names for themselves). -INTERNAL_MACRO_PATTERN = re.compile("^[A-Z][0-9A-Z_]*[A-Z0-9]$") +# +# We make an exception for the helper macros that shadow the functions +# declared by mldsa-native. +INTERNAL_MACRO_PATTERN = re.compile( + "^([A-Z][0-9A-Z_]*[A-Z0-9]|tf_psa_crypto_pqcp_mldsa[a-zA-Z0-9_]*[a-zA-Z0-9])$" +) CONSTANTS_PATTERN = PUBLIC_MACRO_PATTERN IDENTIFIER_PATTERN = re.compile(r"^(mbedtls|psa|tf_psa_crypto)_[0-9a-z_]*[0-9a-z]$")