psa_crypto.c, test_suite_psa_crypto.function: fix style
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index cdefcf8..d9c8235 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -4909,14 +4909,14 @@
goto cleanup;
}
- while ( key_out_of_range )
+ while( key_out_of_range )
{
/* 1. Draw a byte string of length ceiling(m/8) bytes. */
- if ( ( status = psa_key_derivation_output_bytes( operation, *data, m_bytes ) ) != 0 )
+ if( ( status = psa_key_derivation_output_bytes( operation, *data, m_bytes ) ) != 0 )
goto cleanup;
/* 2. If m is not a multiple of 8 */
- if ( m % 8 != 0 )
+ if( m % 8 != 0 )
{
/* Set the most significant
* (8 * ceiling(m/8) - m) bits of the first byte in
@@ -4944,7 +4944,7 @@
cleanup:
if( ret != 0 )
status = mbedtls_to_psa_error( ret );
- if ( status != PSA_SUCCESS ) {
+ if( status != PSA_SUCCESS ) {
mbedtls_free( *data );
*data = NULL;
}
@@ -5041,10 +5041,10 @@
defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_ECDH)
- if ( PSA_KEY_TYPE_IS_ECC( slot->attr.type ) )
+ if( PSA_KEY_TYPE_IS_ECC( slot->attr.type ) )
{
psa_ecc_family_t curve = PSA_KEY_TYPE_ECC_GET_FAMILY( slot->attr.type );
- if ( PSA_ECC_FAMILY_IS_WEIERSTRASS( curve ) )
+ if( PSA_ECC_FAMILY_IS_WEIERSTRASS( curve ) )
{
/* Weierstrass elliptic curve */
status = psa_generate_derived_ecc_key_weierstrass_helper( slot, bits, operation, &data );
diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function
index f21aa6e..b7c0371 100644
--- a/tests/suites/test_suite_psa_crypto.function
+++ b/tests/suites/test_suite_psa_crypto.function
@@ -6784,11 +6784,11 @@
PSA_ASSERT( psa_import_key( &base_attributes, key_data->x, key_data->len,
&base_key ) );
- if( !mbedtls_test_psa_setup_key_derivation_wrap(
+ if( mbedtls_test_psa_setup_key_derivation_wrap(
&operation, base_key, alg,
input1->x, input1->len,
input2->x, input2->len,
- PSA_KEY_DERIVATION_UNLIMITED_CAPACITY ) )
+ PSA_KEY_DERIVATION_UNLIMITED_CAPACITY ) == 0 )
goto exit;
psa_set_key_usage_flags( &derived_attributes, PSA_KEY_USAGE_EXPORT );