adjust indentation per Mbed TLS standards

This commit is contained in:
Moran Peker 2018-05-31 14:07:14 +03:00 committed by itayzafrir
parent ae382791fb
commit 395db875e6

View file

@ -1455,9 +1455,11 @@ psa_status_t psa_cipher_update(psa_cipher_operation_t *operation,
size_t *output_length)
{
int ret = MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE;
if( ( ( PSA_ALG_IS_STREAM_CIPHER( operation->alg ) ) && ( output_size < input_length ) )
|| ( ( PSA_ALG_IS_BLOCK_CIPHER(operation->alg)) && ( output_size < ((operation->ctx.cipher.unprocessed_len + input_length)/16)*16 ) ) )
size_t expected_output_size = ( ( operation->ctx.cipher.unprocessed_len + input_length )/operation->block_size )*operation->block_size;
if( ( ( PSA_ALG_IS_STREAM_CIPHER( operation->alg ) ) &&
( output_size < input_length ) ) ||
( ( PSA_ALG_IS_BLOCK_CIPHER( operation->alg ) ) &&
( output_size < expected_output_size ) ) )
return( PSA_ERROR_BUFFER_TOO_SMALL );
ret = mbedtls_cipher_update( &operation->ctx.cipher, input,