diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h index 5a954ee39..455b6388b 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -2032,8 +2032,6 @@ * #PSA_ECC_FAMILY_SECP_R1), so the input must be exactly 65 bytes. */ #define PSA_ALG_TLS12_ECJPAKE_TO_PMS ((psa_algorithm_t)0x08000600) -#define PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS(alg) \ - (alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS) /* This flag indicates whether the key derivation algorithm is suitable for * use on low-entropy secrets such as password - these algorithms are also diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 981b6f8ff..8c59cf68f 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -4352,7 +4352,7 @@ psa_status_t psa_key_derivation_abort( psa_key_derivation_operation_t *operation #endif /* defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF) || * defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS) */ #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS) - if( PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) + if( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS ) { mbedtls_platform_zeroize( operation->ctx.tls12_ecjpake_to_pms.data, PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE ); @@ -4720,7 +4720,7 @@ psa_status_t psa_key_derivation_output_bytes( #endif /* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF || * MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS */ #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS) - if( PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) + if( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS ) { status = psa_key_derivation_tls12_ecjpake_to_pms_read( &operation->ctx.tls12_ecjpake_to_pms, output, output_length ); @@ -5121,7 +5121,7 @@ static int is_kdf_alg_supported( psa_algorithm_t kdf_alg ) return( 1 ); #endif #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS) - if( PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) + if( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS ) return( 1 ); #endif return( 0 ); @@ -5151,7 +5151,7 @@ static psa_status_t psa_key_derivation_setup_kdf( * ecjpake to pms) are based on a hash algorithm. */ psa_algorithm_t hash_alg = PSA_ALG_HKDF_GET_HASH( kdf_alg ); size_t hash_size = PSA_HASH_LENGTH( hash_alg ); - if( !PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) + if( kdf_alg != PSA_ALG_TLS12_ECJPAKE_TO_PMS ) { if( hash_size == 0 ) return( PSA_ERROR_NOT_SUPPORTED ); @@ -5176,7 +5176,7 @@ static psa_status_t psa_key_derivation_setup_kdf( } #if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT) if( PSA_ALG_IS_HKDF_EXTRACT( kdf_alg ) || - PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS ( kdf_alg )) + ( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS ) ) operation->capacity = hash_size; else #endif /* MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT */ @@ -5668,7 +5668,7 @@ static psa_status_t psa_key_derivation_input_internal( else #endif /* MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS */ #if defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS) - if( PSA_ALG_IS_TLS12_ECJPAKE_TO_PMS( kdf_alg ) ) + if( kdf_alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS ) { status = psa_tls12_ecjpake_to_pms_input( &operation->ctx.tls12_ecjpake_to_pms, step, data, data_length );