blob: 3502bdc8f3c65f80c12c6d79400fca2f5954689b [file] [log] [blame]
Antonio de Angelis377a1552018-11-22 17:02:40 +00001/*
Jamie Fox0e54ebc2019-04-09 14:21:04 +01002 * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
Antonio de Angelis377a1552018-11-22 17:02:40 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7/**
Jamie Foxcc31d402019-01-28 17:13:52 +00008 * \file psa/crypto_struct.h
Antonio de Angelis377a1552018-11-22 17:02:40 +00009 *
10 * \brief PSA cryptography module: structured type implementations
11 *
12 * \note This file may not be included directly. Applications must
Jamie Foxcc31d402019-01-28 17:13:52 +000013 * include psa/crypto.h.
Antonio de Angelis377a1552018-11-22 17:02:40 +000014 *
15 * This file contains the definitions of some data structures with
16 * implementation-specific definitions.
17 *
18 * In implementations with isolation between the application and the
19 * cryptography module, it is expected that the front-end and the back-end
20 * would have different versions of this file.
21 */
22
23#ifndef PSA_CRYPTO_STRUCT_H
24#define PSA_CRYPTO_STRUCT_H
25
26struct psa_hash_operation_s
27{
28 uint32_t handle;
29};
30
Jamie Fox0e54ebc2019-04-09 14:21:04 +010031#define PSA_HASH_OPERATION_INIT {0}
32static inline struct psa_hash_operation_s psa_hash_operation_init( void )
33{
34 const struct psa_hash_operation_s v = PSA_HASH_OPERATION_INIT;
35 return( v );
36}
37
Antonio de Angelis377a1552018-11-22 17:02:40 +000038struct psa_mac_operation_s
39{
40 uint32_t handle;
41};
42
Jamie Fox0e54ebc2019-04-09 14:21:04 +010043#define PSA_MAC_OPERATION_INIT {0}
44static inline struct psa_mac_operation_s psa_mac_operation_init( void )
45{
46 const struct psa_mac_operation_s v = PSA_MAC_OPERATION_INIT;
47 return( v );
48}
49
Antonio de Angelis377a1552018-11-22 17:02:40 +000050struct psa_cipher_operation_s
51{
52 uint32_t handle;
53};
54
Jamie Fox0e54ebc2019-04-09 14:21:04 +010055#define PSA_CIPHER_OPERATION_INIT {0}
56static inline struct psa_cipher_operation_s psa_cipher_operation_init( void )
57{
58 const struct psa_cipher_operation_s v = PSA_CIPHER_OPERATION_INIT;
59 return( v );
60}
61
62struct psa_crypto_generator_s
63{
64 uint32_t handle;
65};
66
67#define PSA_CRYPTO_GENERATOR_INIT {0}
68static inline struct psa_crypto_generator_s psa_crypto_generator_init( void )
69{
70 const struct psa_crypto_generator_s v = PSA_CRYPTO_GENERATOR_INIT;
71 return( v );
72}
73
Antonio de Angelis377a1552018-11-22 17:02:40 +000074struct psa_key_policy_s
75{
76 psa_key_usage_t usage;
77 psa_algorithm_t alg;
78};
79
Jamie Fox0e54ebc2019-04-09 14:21:04 +010080#define PSA_KEY_POLICY_INIT {0, 0}
81static inline struct psa_key_policy_s psa_key_policy_init( void )
82{
83 const struct psa_key_policy_s v = PSA_KEY_POLICY_INIT;
84 return( v );
85}
86
Antonio de Angelis377a1552018-11-22 17:02:40 +000087#endif /* PSA_CRYPTO_STRUCT_H */