Antonio de Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 1 | /* |
Jamie Fox | 0e54ebc | 2019-04-09 14:21:04 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2019, Arm Limited. All rights reserved. |
Antonio de Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | /** |
Jamie Fox | cc31d40 | 2019-01-28 17:13:52 +0000 | [diff] [blame^] | 8 | * \file psa/crypto_struct.h |
Antonio de Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 9 | * |
| 10 | * \brief PSA cryptography module: structured type implementations |
| 11 | * |
| 12 | * \note This file may not be included directly. Applications must |
Jamie Fox | cc31d40 | 2019-01-28 17:13:52 +0000 | [diff] [blame^] | 13 | * include psa/crypto.h. |
Antonio de Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 14 | * |
| 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 | |
| 26 | struct psa_hash_operation_s |
| 27 | { |
| 28 | uint32_t handle; |
| 29 | }; |
| 30 | |
Jamie Fox | 0e54ebc | 2019-04-09 14:21:04 +0100 | [diff] [blame] | 31 | #define PSA_HASH_OPERATION_INIT {0} |
| 32 | static 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 Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 38 | struct psa_mac_operation_s |
| 39 | { |
| 40 | uint32_t handle; |
| 41 | }; |
| 42 | |
Jamie Fox | 0e54ebc | 2019-04-09 14:21:04 +0100 | [diff] [blame] | 43 | #define PSA_MAC_OPERATION_INIT {0} |
| 44 | static 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 Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 50 | struct psa_cipher_operation_s |
| 51 | { |
| 52 | uint32_t handle; |
| 53 | }; |
| 54 | |
Jamie Fox | 0e54ebc | 2019-04-09 14:21:04 +0100 | [diff] [blame] | 55 | #define PSA_CIPHER_OPERATION_INIT {0} |
| 56 | static 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 | |
| 62 | struct psa_crypto_generator_s |
| 63 | { |
| 64 | uint32_t handle; |
| 65 | }; |
| 66 | |
| 67 | #define PSA_CRYPTO_GENERATOR_INIT {0} |
| 68 | static 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 Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 74 | struct psa_key_policy_s |
| 75 | { |
| 76 | psa_key_usage_t usage; |
| 77 | psa_algorithm_t alg; |
| 78 | }; |
| 79 | |
Jamie Fox | 0e54ebc | 2019-04-09 14:21:04 +0100 | [diff] [blame] | 80 | #define PSA_KEY_POLICY_INIT {0, 0} |
| 81 | static 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 Angelis | 377a155 | 2018-11-22 17:02:40 +0000 | [diff] [blame] | 87 | #endif /* PSA_CRYPTO_STRUCT_H */ |