a-style fixes for code

pull/9758/head
Nir Sonnenschein 2019-02-24 14:25:25 +02:00
parent 4a4af57c22
commit ffaf083b75
1 changed files with 14 additions and 18 deletions

View File

@ -36,7 +36,7 @@ static int psa_spm_init_refence_counter = 0;
/* maximal memoty allocation for reading large hash ort mac input buffers.
the data will be read in chunks of size */
#if !defined (MAX_DATA_CHUNK_SIZE_IN_BYTES)
#define MAX_DATA_CHUNK_SIZE_IN_BYTES 400
#define MAX_DATA_CHUNK_SIZE_IN_BYTES 400
#endif
#ifndef MAX_CONCURRENT_HASH_CLONES
@ -228,7 +228,7 @@ static void psa_mac_operation(void)
case PSA_MAC_UPDATE: {
uint8_t * input_buffer = NULL;
uint8_t *input_buffer = NULL;
size_t data_remaining = msg.in_size[1];
size_t allocation_size = MIN(data_remaining, MAX_DATA_CHUNK_SIZE_IN_BYTES);
size_t size_to_read = 0;
@ -239,8 +239,7 @@ static void psa_mac_operation(void)
break;
}
while (data_remaining > 0)
{
while (data_remaining > 0) {
size_to_read = MIN(data_remaining, MAX_DATA_CHUNK_SIZE_IN_BYTES);
bytes_read = psa_read(msg.handle, 1, input_buffer,
size_to_read);
@ -254,8 +253,7 @@ static void psa_mac_operation(void)
bytes_read);
// stop on error
if (status != PSA_SUCCESS)
{
if (status != PSA_SUCCESS) {
break;
}
data_remaining = data_remaining - bytes_read;
@ -392,7 +390,7 @@ static void psa_hash_operation(void)
}
case PSA_HASH_UPDATE: {
uint8_t * input_buffer = NULL;
uint8_t *input_buffer = NULL;
size_t data_remaining = msg.in_size[1];
size_t size_to_read = 0;
size_t allocation_size = MIN(data_remaining, MAX_DATA_CHUNK_SIZE_IN_BYTES);
@ -403,8 +401,7 @@ static void psa_hash_operation(void)
break;
}
while (data_remaining > 0)
{
while (data_remaining > 0) {
size_to_read = MIN(data_remaining, MAX_DATA_CHUNK_SIZE_IN_BYTES);
bytes_read = psa_read(msg.handle, 1, input_buffer,
size_to_read);
@ -418,8 +415,7 @@ static void psa_hash_operation(void)
bytes_read);
// stop on error
if (status != PSA_SUCCESS)
{
if (status != PSA_SUCCESS) {
break;
}
data_remaining = data_remaining - bytes_read;