Readability improvements

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2021-10-08 16:28:32 +02:00
parent 44fa40cd56
commit f8362ca847
2 changed files with 3 additions and 3 deletions

View file

@ -1373,8 +1373,8 @@
* a supported algorithm identifier or policy. * a supported algorithm identifier or policy.
*/ */
#define PSA_ALG_IS_RSA_PSS(alg) \ #define PSA_ALG_IS_RSA_PSS(alg) \
((((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_PSS_BASE) || \ (PSA_ALG_IS_RSA_PSS_STANDARD_SALT(alg) || \
(((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_PSS_ANY_SALT_BASE)) PSA_ALG_IS_RSA_PSS_ANY_SALT(alg))
#define PSA_ALG_ECDSA_BASE ((psa_algorithm_t)0x06000600) #define PSA_ALG_ECDSA_BASE ((psa_algorithm_t)0x06000600)
/** ECDSA signature with hashing. /** ECDSA signature with hashing.

View file

@ -456,7 +456,7 @@ static int rsa_pss_expected_salt_len( psa_algorithm_t alg,
return( MBEDTLS_RSA_SALT_LEN_ANY ); return( MBEDTLS_RSA_SALT_LEN_ANY );
/* Otherwise: standard salt length, i.e. largest possible salt length /* Otherwise: standard salt length, i.e. largest possible salt length
* up to the hash 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 hlen = (int) hash_length; // known to fit
int room = klen - 2 - hlen; int room = klen - 2 - hlen;
if( room < 0 ) if( room < 0 )