psa_crypto.c, test_suite_psa_crypto.function: fix style

Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
Przemek Stekiel 2022-03-08 11:37:54 +01:00
parent 7fc0751f78
commit c85f0912c4
2 changed files with 8 additions and 8 deletions

View File

@ -4909,14 +4909,14 @@ static psa_status_t psa_generate_derived_ecc_key_weierstrass_helper(
goto cleanup; goto cleanup;
} }
while ( key_out_of_range ) while( key_out_of_range )
{ {
/* 1. Draw a byte string of length ceiling(m/8) bytes. */ /* 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; goto cleanup;
/* 2. If m is not a multiple of 8 */ /* 2. If m is not a multiple of 8 */
if ( m % 8 != 0 ) if( m % 8 != 0 )
{ {
/* Set the most significant /* Set the most significant
* (8 * ceiling(m/8) - m) bits of the first byte in * (8 * ceiling(m/8) - m) bits of the first byte in
@ -4944,7 +4944,7 @@ static psa_status_t psa_generate_derived_ecc_key_weierstrass_helper(
cleanup: cleanup:
if( ret != 0 ) if( ret != 0 )
status = mbedtls_to_psa_error( ret ); status = mbedtls_to_psa_error( ret );
if ( status != PSA_SUCCESS ) { if( status != PSA_SUCCESS ) {
mbedtls_free( *data ); mbedtls_free( *data );
*data = NULL; *data = NULL;
} }
@ -5041,10 +5041,10 @@ static psa_status_t psa_generate_derived_key_internal(
defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \ defined(MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) || \ defined(MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_ECDH) 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 ); 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 */ /* Weierstrass elliptic curve */
status = psa_generate_derived_ecc_key_weierstrass_helper( slot, bits, operation, &data ); status = psa_generate_derived_ecc_key_weierstrass_helper( slot, bits, operation, &data );

View File

@ -6784,11 +6784,11 @@ void derive_key_type( int alg_arg,
PSA_ASSERT( psa_import_key( &base_attributes, key_data->x, key_data->len, PSA_ASSERT( psa_import_key( &base_attributes, key_data->x, key_data->len,
&base_key ) ); &base_key ) );
if( !mbedtls_test_psa_setup_key_derivation_wrap( if( mbedtls_test_psa_setup_key_derivation_wrap(
&operation, base_key, alg, &operation, base_key, alg,
input1->x, input1->len, input1->x, input1->len,
input2->x, input2->len, input2->x, input2->len,
PSA_KEY_DERIVATION_UNLIMITED_CAPACITY ) ) PSA_KEY_DERIVATION_UNLIMITED_CAPACITY ) == 0 )
goto exit; goto exit;
psa_set_key_usage_flags( &derived_attributes, PSA_KEY_USAGE_EXPORT ); psa_set_key_usage_flags( &derived_attributes, PSA_KEY_USAGE_EXPORT );