diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h index aa7d02ef39..86a03d125f 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -1425,8 +1425,8 @@ * a supported algorithm identifier or policy. */ #define PSA_ALG_IS_RSA_PSS(alg) \ - ((((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_PSS_BASE) || \ - (((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_PSS_ANY_SALT_BASE)) + (PSA_ALG_IS_RSA_PSS_STANDARD_SALT(alg) || \ + PSA_ALG_IS_RSA_PSS_ANY_SALT(alg)) #define PSA_ALG_ECDSA_BASE ((psa_algorithm_t)0x06000600) /** ECDSA signature with hashing. diff --git a/library/psa_crypto_rsa.c b/library/psa_crypto_rsa.c index 7ee15ea077..8318ef47b3 100644 --- a/library/psa_crypto_rsa.c +++ b/library/psa_crypto_rsa.c @@ -462,7 +462,7 @@ static int rsa_pss_expected_salt_len( psa_algorithm_t alg, return( MBEDTLS_RSA_SALT_LEN_ANY ); /* Otherwise: standard salt length, i.e. largest possible salt length * up to the hash length. */ - int klen = (int) (int) mbedtls_rsa_get_len( rsa ); // known to fit + int klen = (int) mbedtls_rsa_get_len( rsa ); // known to fit int hlen = (int) hash_length; // known to fit int room = klen - 2 - hlen; if( room < 0 )