Skip to content

Commit

Permalink
sys/psa_crypto: fix PSA signing macros
Browse files Browse the repository at this point in the history
  • Loading branch information
mguetschow committed Sep 28, 2023
1 parent a67890f commit c1fd585
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sys/include/psa_crypto/psa/crypto_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit c1fd585

Please sign in to comment.