diff --git a/sys/include/psa_crypto/psa/crypto_values.h b/sys/include/psa_crypto/psa/crypto_values.h index 3723d17ebea64..7de569dc0e440 100644 --- a/sys/include/psa_crypto/psa/crypto_values.h +++ b/sys/include/psa_crypto/psa/crypto_values.h @@ -526,9 +526,9 @@ extern "C" { * A wildcard signature algorithm policy, using @ref PSA_ALG_ANY_HASH, returns the same * value as the signature algorithm parameterised with a valid hash algorithm. */ -#define PSA_ALG_IS_HASH_AND_SIGN(alg) \ - (PSA_ALG_IS_RSA_PSS(alg) || PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg) || \ - PSA_ALG_IS_ECDSA(alg) || PSA_ALG_IS_HASH_EDDSA(alg)) +#define PSA_ALG_IS_HASH_AND_SIGN(alg) \ + (PSA_ALG_IS_SIGN_HASH(alg) && \ + ((alg) & PSA_ALG_HASH_MASK) != 0) /** * @brief Whether the specified algorithm is an HKDF algorithm. @@ -746,7 +746,8 @@ extern "C" { * 0 if alg is not a signature algorithm */ #define PSA_ALG_IS_SIGN_HASH(alg) \ - PSA_ALG_IS_SIGN(alg) + (PSA_ALG_IS_RSA_PSS(alg) || PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg) || \ + PSA_ALG_IS_ECDSA(alg) || PSA_ALG_IS_HASH_EDDSA(alg)) /** * @brief Whether the specified algorithm is a signature algorithm that can be used with @@ -760,8 +761,7 @@ extern "C" { * 0 if alg is not a signature algorithm. */ #define PSA_ALG_IS_SIGN_MESSAGE(alg) \ - (PSA_ALG_IS_SIGN(alg) && \ - (alg) != PSA_ALG_ECDSA_ANY && (alg) != PSA_ALG_RSA_PKCS1V15_SIGN_RAW) + (PSA_ALG_IS_SIGN_HASH(alg) || (alg) == PSA_ALG_PURE_EDDSA) /** * @brief Whether the specified algorithm is a stream cipher.