Skip to content

Commit ffaf083

Browse files
author
Nir Sonnenschein
committed
a-style fixes for code
1 parent 4a4af57 commit ffaf083

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static int psa_spm_init_refence_counter = 0;
3636
/* maximal memoty allocation for reading large hash ort mac input buffers.
3737
the data will be read in chunks of size */
3838
#if !defined (MAX_DATA_CHUNK_SIZE_IN_BYTES)
39-
#define MAX_DATA_CHUNK_SIZE_IN_BYTES 400
39+
#define MAX_DATA_CHUNK_SIZE_IN_BYTES 400
4040
#endif
4141

4242
#ifndef MAX_CONCURRENT_HASH_CLONES
@@ -96,7 +96,7 @@ static void destroy_hash_clone(void *source_operation)
9696
}
9797

9898
static inline psa_status_t get_hash_clone(size_t index, int32_t partition_id,
99-
psa_spm_hash_clone_t **hash_clone)
99+
psa_spm_hash_clone_t **hash_clone)
100100
{
101101
if (index >= MAX_CONCURRENT_HASH_CLONES ||
102102
psa_spm_hash_clones[index].partition_id != partition_id ||
@@ -228,7 +228,7 @@ static void psa_mac_operation(void)
228228

229229
case PSA_MAC_UPDATE: {
230230

231-
uint8_t * input_buffer = NULL;
231+
uint8_t *input_buffer = NULL;
232232
size_t data_remaining = msg.in_size[1];
233233
size_t allocation_size = MIN(data_remaining, MAX_DATA_CHUNK_SIZE_IN_BYTES);
234234
size_t size_to_read = 0;
@@ -239,8 +239,7 @@ static void psa_mac_operation(void)
239239
break;
240240
}
241241

242-
while (data_remaining > 0)
243-
{
242+
while (data_remaining > 0) {
244243
size_to_read = MIN(data_remaining, MAX_DATA_CHUNK_SIZE_IN_BYTES);
245244
bytes_read = psa_read(msg.handle, 1, input_buffer,
246245
size_to_read);
@@ -252,15 +251,14 @@ static void psa_mac_operation(void)
252251
status = psa_mac_update(msg.rhandle,
253252
input_buffer,
254253
bytes_read);
255-
256-
// stop on error
257-
if (status != PSA_SUCCESS)
258-
{
254+
255+
// stop on error
256+
if (status != PSA_SUCCESS) {
259257
break;
260258
}
261259
data_remaining = data_remaining - bytes_read;
262260
}
263-
261+
264262
mbedtls_free(input_buffer);
265263

266264
break;
@@ -392,7 +390,7 @@ static void psa_hash_operation(void)
392390
}
393391

394392
case PSA_HASH_UPDATE: {
395-
uint8_t * input_buffer = NULL;
393+
uint8_t *input_buffer = NULL;
396394
size_t data_remaining = msg.in_size[1];
397395
size_t size_to_read = 0;
398396
size_t allocation_size = MIN(data_remaining, MAX_DATA_CHUNK_SIZE_IN_BYTES);
@@ -403,8 +401,7 @@ static void psa_hash_operation(void)
403401
break;
404402
}
405403

406-
while (data_remaining > 0)
407-
{
404+
while (data_remaining > 0) {
408405
size_to_read = MIN(data_remaining, MAX_DATA_CHUNK_SIZE_IN_BYTES);
409406
bytes_read = psa_read(msg.handle, 1, input_buffer,
410407
size_to_read);
@@ -414,12 +411,11 @@ static void psa_hash_operation(void)
414411
}
415412

416413
status = psa_hash_update(msg.rhandle,
417-
input_buffer,
418-
bytes_read);
414+
input_buffer,
415+
bytes_read);
419416

420-
// stop on error
421-
if (status != PSA_SUCCESS)
422-
{
417+
// stop on error
418+
if (status != PSA_SUCCESS) {
423419
break;
424420
}
425421
data_remaining = data_remaining - bytes_read;

0 commit comments

Comments
 (0)