Astyle fixes for the source

Used running: astyle -n --options=.astylerc
pull/8804/head
mohammad1603 2018-11-26 23:32:45 +02:00
parent 5c2cf07780
commit 88f4f48fac
6 changed files with 1485 additions and 1495 deletions

View File

@ -52,8 +52,9 @@ static void check_multi_crypto_init_deinit()
uint8_t output[TEST_RANDOM_SIZE] = {0};
uint8_t seed[MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE] = {0};
/* inject some a seed for test*/
for(int i; i < MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE; ++i)
for (int i; i < MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE; ++i) {
seed[i] = i;
}
/* don't really care if this succeed this is just to make crypto init pass*/
mbedtls_psa_inject_entropy(seed, MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE);
psa_status_t status = psa_crypto_init();
@ -76,8 +77,9 @@ static void check_crypto_init_deinit()
uint8_t output[TEST_RANDOM_SIZE] = {0};
uint8_t seed[MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE] = {0};
/* inject some a seed for test*/
for(int i; i < MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE; ++i)
for (int i; i < MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE; ++i) {
seed[i] = i;
}
/* don't really care if this succeed this is just to make crypto init pass*/
mbedtls_psa_inject_entropy(seed, MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE);
status = psa_generate_random(output, sizeof(output));

View File

@ -130,8 +130,7 @@ utest::v1::status_t case_setup_handler(const Case *const source, const size_t in
status = test_psa_its_reset();
TEST_ASSERT_EQUAL(PSA_ITS_SUCCESS, status);
/* fill seed in some data */
for( size_t i = 0; i < MBEDTLS_ENTROPY_MAX_SEED_SIZE+2; ++i)
{
for (size_t i = 0; i < MBEDTLS_ENTROPY_MAX_SEED_SIZE + 2; ++i) {
seed[i] = i;
}
return greentea_case_setup_handler(source, index_of_case);

View File

@ -38,8 +38,7 @@
*/
/** \brief psa_s_function_t enum defines for all the available functions in PSA Crypto. */
typedef enum psa_sec_function_s
{
typedef enum psa_sec_function_s {
PSA_CRYPTO_INVALID,
PSA_CRYPTO_INIT,
PSA_IMPORT_KEY,
@ -101,8 +100,7 @@ typedef enum psa_sec_function_s
* pack them together.
*/
typedef struct psa_crypto_ipc_s
{
typedef struct psa_crypto_ipc_s {
psa_sec_function_t func;
psa_key_slot_t key;
psa_algorithm_t alg;
@ -113,8 +111,7 @@ typedef struct psa_crypto_ipc_s
* and in order to use the existing infrastructure of the SPM-IPC we provide a struct to
* pack them together.
*/
typedef struct psa_crypto_derivation_ipc_s
{
typedef struct psa_crypto_derivation_ipc_s {
psa_sec_function_t func;
psa_key_slot_t key;
psa_algorithm_t alg;
@ -127,8 +124,7 @@ typedef struct psa_crypto_derivation_ipc_s
* pack them together.
*/
typedef struct psa_key_mng_ipc_s
{
typedef struct psa_key_mng_ipc_s {
psa_key_slot_t key;
psa_key_type_t type;
psa_sec_function_t func;
@ -142,8 +138,7 @@ typedef struct psa_key_mng_ipc_s
// Max length supported for nonce is 16 bytes.
#define PSA_AEAD_MAX_NONCE_SIZE 16
typedef struct psa_crypto_ipc_aead_s
{
typedef struct psa_crypto_ipc_aead_s {
psa_sec_function_t func;
psa_key_slot_t key;
psa_algorithm_t alg;
@ -158,8 +153,7 @@ typedef struct psa_crypto_ipc_aead_s
* and in order to use the existing infrastructure of the SPM-IPC we provide a struct to
* pack them together.
*/
typedef struct psa_crypto_ipc_asymmetric_s
{
typedef struct psa_crypto_ipc_asymmetric_s {
psa_sec_function_t func;
psa_key_slot_t key;
psa_algorithm_t alg;

View File

@ -27,28 +27,23 @@
#ifndef PSA_CRYPTO_STRUCT_H
#define PSA_CRYPTO_STRUCT_H
struct psa_hash_operation_s
{
struct psa_hash_operation_s {
psa_handle_t handle;
};
struct psa_mac_operation_s
{
struct psa_mac_operation_s {
psa_handle_t handle;
};
struct psa_cipher_operation_s
{
struct psa_cipher_operation_s {
psa_handle_t handle;
};
struct psa_aead_operation_s
{
struct psa_aead_operation_s {
psa_handle_t handle;
};
struct psa_crypto_generator_s
{
struct psa_crypto_generator_s {
psa_handle_t handle;
};
@ -58,8 +53,7 @@ static inline struct psa_crypto_generator_s psa_crypto_generator_init( void )
return (v);
}
struct psa_key_policy_s
{
struct psa_key_policy_s {
psa_key_usage_t usage;
psa_algorithm_t alg;
};