Skip to content

Commit dda4c47

Browse files
committed
crypto: Match styles of crypto struct headers
Make crypto_struct_ipc.h (for use with PSA Crypto clients) match style with the file it is based on, crypto_struct.h (from Mbed Crypto). This helps to keep the file diff minimal so it's easy to see the meaningful (non-style) changes.
1 parent e31916f commit dda4c47

File tree

2 files changed

+31
-15
lines changed

2 files changed

+31
-15
lines changed

.astyleignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
^components/TARGET_PSA/services/attestation/attestation.h
55
^components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/tfm_impl
66
^components/TARGET_PSA/services/attestation/qcbor
7+
^components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/crypto_struct_ipc.h
78
^components/TARGET_PSA/TARGET_TFM
89
^components/TARGET_PSA/TESTS
910
^features/cryptocell

components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/crypto_struct_ipc.h

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
* \file psa/crypto_struct.h
33
*
44
* \brief PSA cryptography module: Mbed TLS structured type implementations
5+
*
6+
* \note This file may not be included directly. Applications must
7+
* include psa/crypto.h.
8+
*
9+
* This file contains the definitions of some data structures with
10+
* implementation-specific definitions.
11+
*
12+
* In implementations with isolation between the application and the
13+
* cryptography module, it is expected that the front-end and the back-end
14+
* would have different versions of this file.
515
*/
616
/*
717
* Copyright (C) 2018, ARM Limited, All Rights Reserved
@@ -27,60 +37,65 @@
2737

2838
#include "psa/client.h"
2939

30-
struct psa_hash_operation_s {
40+
struct psa_hash_operation_s
41+
{
3142
psa_handle_t handle;
3243
};
3344

3445
#define PSA_HASH_OPERATION_INIT { PSA_NULL_HANDLE }
35-
static inline struct psa_hash_operation_s psa_hash_operation_init(void)
46+
static inline struct psa_hash_operation_s psa_hash_operation_init( void )
3647
{
3748
const struct psa_hash_operation_s v = PSA_HASH_OPERATION_INIT;
38-
return (v);
49+
return( v );
3950
}
4051

41-
struct psa_mac_operation_s {
52+
struct psa_mac_operation_s
53+
{
4254
psa_handle_t handle;
4355
};
4456

4557
#define PSA_MAC_OPERATION_INIT { PSA_NULL_HANDLE }
46-
static inline struct psa_mac_operation_s psa_mac_operation_init(void)
58+
static inline struct psa_mac_operation_s psa_mac_operation_init( void )
4759
{
4860
const struct psa_mac_operation_s v = PSA_MAC_OPERATION_INIT;
49-
return (v);
61+
return( v );
5062
}
5163

52-
struct psa_cipher_operation_s {
64+
struct psa_cipher_operation_s
65+
{
5366
psa_handle_t handle;
5467
};
5568

5669
#define PSA_CIPHER_OPERATION_INIT { PSA_NULL_HANDLE }
57-
static inline struct psa_cipher_operation_s psa_cipher_operation_init(void)
70+
static inline struct psa_cipher_operation_s psa_cipher_operation_init( void )
5871
{
5972
const struct psa_cipher_operation_s v = PSA_CIPHER_OPERATION_INIT;
60-
return (v);
73+
return( v );
6174
}
6275

63-
struct psa_crypto_generator_s {
76+
struct psa_crypto_generator_s
77+
{
6478
psa_handle_t handle;
6579
};
6680

6781
#define PSA_CRYPTO_GENERATOR_INIT { PSA_NULL_HANDLE }
68-
static inline struct psa_crypto_generator_s psa_crypto_generator_init(void)
82+
static inline struct psa_crypto_generator_s psa_crypto_generator_init( void )
6983
{
7084
const struct psa_crypto_generator_s v = PSA_CRYPTO_GENERATOR_INIT;
71-
return (v);
85+
return( v );
7286
}
7387

74-
struct psa_key_policy_s {
88+
struct psa_key_policy_s
89+
{
7590
psa_key_usage_t usage;
7691
psa_algorithm_t alg;
7792
};
7893

7994
#define PSA_KEY_POLICY_INIT {0, 0}
80-
static inline struct psa_key_policy_s psa_key_policy_init(void)
95+
static inline struct psa_key_policy_s psa_key_policy_init( void )
8196
{
8297
const struct psa_key_policy_s v = PSA_KEY_POLICY_INIT;
83-
return (v);
98+
return( v );
8499
}
85100

86101
#endif /* PSA_CRYPTO_STRUCT_H */

0 commit comments

Comments
 (0)