Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-27 09:43:23

0001 /**
0002  * \file psa/crypto_struct.h
0003  *
0004  * \brief PSA cryptography module: Mbed TLS structured type implementations
0005  *
0006  * \note This file may not be included directly. Applications must
0007  * include psa/crypto.h.
0008  *
0009  * This file contains the definitions of some data structures with
0010  * implementation-specific definitions.
0011  *
0012  * In implementations with isolation between the application and the
0013  * cryptography module, it is expected that the front-end and the back-end
0014  * would have different versions of this file.
0015  *
0016  * <h3>Design notes about multipart operation structures</h3>
0017  *
0018  * For multipart operations without driver delegation support, each multipart
0019  * operation structure contains a `psa_algorithm_t alg` field which indicates
0020  * which specific algorithm the structure is for. When the structure is not in
0021  * use, `alg` is 0. Most of the structure consists of a union which is
0022  * discriminated by `alg`.
0023  *
0024  * For multipart operations with driver delegation support, each multipart
0025  * operation structure contains an `unsigned int id` field indicating which
0026  * driver got assigned to do the operation. When the structure is not in use,
0027  * 'id' is 0. The structure contains also a driver context which is the union
0028  * of the contexts of all drivers able to handle the type of multipart
0029  * operation.
0030  *
0031  * Note that when `alg` or `id` is 0, the content of other fields is undefined.
0032  * In particular, it is not guaranteed that a freshly-initialized structure
0033  * is all-zero: we initialize structures to something like `{0, 0}`, which
0034  * is only guaranteed to initializes the first member of the union;
0035  * GCC and Clang initialize the whole structure to 0 (at the time of writing),
0036  * but MSVC and CompCert don't.
0037  *
0038  * In Mbed TLS, multipart operation structures live independently from
0039  * the key. This allows Mbed TLS to free the key objects when destroying
0040  * a key slot. If a multipart operation needs to remember the key after
0041  * the setup function returns, the operation structure needs to contain a
0042  * copy of the key.
0043  */
0044 /*
0045  *  Copyright The Mbed TLS Contributors
0046  *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
0047  */
0048 
0049 #ifndef PSA_CRYPTO_STRUCT_H
0050 #define PSA_CRYPTO_STRUCT_H
0051 #include "mbedtls/private_access.h"
0052 
0053 #ifdef __cplusplus
0054 extern "C" {
0055 #endif
0056 
0057 /*
0058  * Include the build-time configuration information header. Here, we do not
0059  * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which
0060  * is basically just an alias to it. This is to ease the maintenance of the
0061  * TF-PSA-Crypto repository which has a different build system and
0062  * configuration.
0063  */
0064 #include "psa/build_info.h"
0065 
0066 /* Include the context definition for the compiled-in drivers for the primitive
0067  * algorithms. */
0068 #include "psa/crypto_driver_contexts_primitives.h"
0069 
0070 struct psa_hash_operation_s {
0071 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0072     mbedtls_psa_client_handle_t handle;
0073 #else
0074     /** Unique ID indicating which driver got assigned to do the
0075      * operation. Since driver contexts are driver-specific, swapping
0076      * drivers halfway through the operation is not supported.
0077      * ID values are auto-generated in psa_driver_wrappers.h.
0078      * ID value zero means the context is not valid or not assigned to
0079      * any driver (i.e. the driver context is not active, in use). */
0080     unsigned int MBEDTLS_PRIVATE(id);
0081     psa_driver_hash_context_t MBEDTLS_PRIVATE(ctx);
0082 #endif
0083 };
0084 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0085 #define PSA_HASH_OPERATION_INIT { 0 }
0086 #else
0087 #define PSA_HASH_OPERATION_INIT { 0, { 0 } }
0088 #endif
0089 static inline struct psa_hash_operation_s psa_hash_operation_init(void)
0090 {
0091     const struct psa_hash_operation_s v = PSA_HASH_OPERATION_INIT;
0092     return v;
0093 }
0094 
0095 struct psa_cipher_operation_s {
0096 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0097     mbedtls_psa_client_handle_t handle;
0098 #else
0099     /** Unique ID indicating which driver got assigned to do the
0100      * operation. Since driver contexts are driver-specific, swapping
0101      * drivers halfway through the operation is not supported.
0102      * ID values are auto-generated in psa_crypto_driver_wrappers.h
0103      * ID value zero means the context is not valid or not assigned to
0104      * any driver (i.e. none of the driver contexts are active). */
0105     unsigned int MBEDTLS_PRIVATE(id);
0106 
0107     unsigned int MBEDTLS_PRIVATE(iv_required) : 1;
0108     unsigned int MBEDTLS_PRIVATE(iv_set) : 1;
0109 
0110     uint8_t MBEDTLS_PRIVATE(default_iv_length);
0111 
0112     psa_driver_cipher_context_t MBEDTLS_PRIVATE(ctx);
0113 #endif
0114 };
0115 
0116 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0117 #define PSA_CIPHER_OPERATION_INIT { 0 }
0118 #else
0119 #define PSA_CIPHER_OPERATION_INIT { 0, 0, 0, 0, { 0 } }
0120 #endif
0121 static inline struct psa_cipher_operation_s psa_cipher_operation_init(void)
0122 {
0123     const struct psa_cipher_operation_s v = PSA_CIPHER_OPERATION_INIT;
0124     return v;
0125 }
0126 
0127 /* Include the context definition for the compiled-in drivers for the composite
0128  * algorithms. */
0129 #include "psa/crypto_driver_contexts_composites.h"
0130 
0131 struct psa_mac_operation_s {
0132 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0133     mbedtls_psa_client_handle_t handle;
0134 #else
0135     /** Unique ID indicating which driver got assigned to do the
0136      * operation. Since driver contexts are driver-specific, swapping
0137      * drivers halfway through the operation is not supported.
0138      * ID values are auto-generated in psa_driver_wrappers.h
0139      * ID value zero means the context is not valid or not assigned to
0140      * any driver (i.e. none of the driver contexts are active). */
0141     unsigned int MBEDTLS_PRIVATE(id);
0142     uint8_t MBEDTLS_PRIVATE(mac_size);
0143     unsigned int MBEDTLS_PRIVATE(is_sign) : 1;
0144     psa_driver_mac_context_t MBEDTLS_PRIVATE(ctx);
0145 #endif
0146 };
0147 
0148 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0149 #define PSA_MAC_OPERATION_INIT { 0 }
0150 #else
0151 #define PSA_MAC_OPERATION_INIT { 0, 0, 0, { 0 } }
0152 #endif
0153 static inline struct psa_mac_operation_s psa_mac_operation_init(void)
0154 {
0155     const struct psa_mac_operation_s v = PSA_MAC_OPERATION_INIT;
0156     return v;
0157 }
0158 
0159 struct psa_aead_operation_s {
0160 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0161     mbedtls_psa_client_handle_t handle;
0162 #else
0163     /** Unique ID indicating which driver got assigned to do the
0164      * operation. Since driver contexts are driver-specific, swapping
0165      * drivers halfway through the operation is not supported.
0166      * ID values are auto-generated in psa_crypto_driver_wrappers.h
0167      * ID value zero means the context is not valid or not assigned to
0168      * any driver (i.e. none of the driver contexts are active). */
0169     unsigned int MBEDTLS_PRIVATE(id);
0170 
0171     psa_algorithm_t MBEDTLS_PRIVATE(alg);
0172     psa_key_type_t MBEDTLS_PRIVATE(key_type);
0173 
0174     size_t MBEDTLS_PRIVATE(ad_remaining);
0175     size_t MBEDTLS_PRIVATE(body_remaining);
0176 
0177     unsigned int MBEDTLS_PRIVATE(nonce_set) : 1;
0178     unsigned int MBEDTLS_PRIVATE(lengths_set) : 1;
0179     unsigned int MBEDTLS_PRIVATE(ad_started) : 1;
0180     unsigned int MBEDTLS_PRIVATE(body_started) : 1;
0181     unsigned int MBEDTLS_PRIVATE(is_encrypt) : 1;
0182 
0183     psa_driver_aead_context_t MBEDTLS_PRIVATE(ctx);
0184 #endif
0185 };
0186 
0187 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0188 #define PSA_AEAD_OPERATION_INIT { 0 }
0189 #else
0190 #define PSA_AEAD_OPERATION_INIT { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0 } }
0191 #endif
0192 static inline struct psa_aead_operation_s psa_aead_operation_init(void)
0193 {
0194     const struct psa_aead_operation_s v = PSA_AEAD_OPERATION_INIT;
0195     return v;
0196 }
0197 
0198 /* Include the context definition for the compiled-in drivers for the key
0199  * derivation algorithms. */
0200 #include "psa/crypto_driver_contexts_key_derivation.h"
0201 
0202 struct psa_key_derivation_s {
0203 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0204     mbedtls_psa_client_handle_t handle;
0205 #else
0206     psa_algorithm_t MBEDTLS_PRIVATE(alg);
0207     unsigned int MBEDTLS_PRIVATE(can_output_key) : 1;
0208     size_t MBEDTLS_PRIVATE(capacity);
0209     psa_driver_key_derivation_context_t MBEDTLS_PRIVATE(ctx);
0210 #endif
0211 };
0212 
0213 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0214 #define PSA_KEY_DERIVATION_OPERATION_INIT { 0 }
0215 #else
0216 /* This only zeroes out the first byte in the union, the rest is unspecified. */
0217 #define PSA_KEY_DERIVATION_OPERATION_INIT { 0, 0, 0, { 0 } }
0218 #endif
0219 static inline struct psa_key_derivation_s psa_key_derivation_operation_init(
0220     void)
0221 {
0222     const struct psa_key_derivation_s v = PSA_KEY_DERIVATION_OPERATION_INIT;
0223     return v;
0224 }
0225 
0226 struct psa_custom_key_parameters_s {
0227     /* Future versions may add other fields in this structure. */
0228     uint32_t flags;
0229 };
0230 
0231 /** The default production parameters for key generation or key derivation.
0232  *
0233  * Calling psa_generate_key_custom() or psa_key_derivation_output_key_custom()
0234  * with `custom=PSA_CUSTOM_KEY_PARAMETERS_INIT` and `custom_data_length=0` is
0235  * equivalent to calling psa_generate_key() or psa_key_derivation_output_key()
0236  * respectively.
0237  */
0238 #define PSA_CUSTOM_KEY_PARAMETERS_INIT { 0 }
0239 
0240 #ifndef __cplusplus
0241 /* Omitted when compiling in C++, because one of the parameters is a
0242  * pointer to a struct with a flexible array member, and that is not
0243  * standard C++.
0244  * https://github.com/Mbed-TLS/mbedtls/issues/9020
0245  */
0246 /* This is a deprecated variant of `struct psa_custom_key_parameters_s`.
0247  * It has exactly the same layout, plus an extra field which is a flexible
0248  * array member. Thus a `const struct psa_key_production_parameters_s *`
0249  * can be passed to any function that reads a
0250  * `const struct psa_custom_key_parameters_s *`.
0251  */
0252 struct psa_key_production_parameters_s {
0253     uint32_t flags;
0254     uint8_t data[];
0255 };
0256 
0257 /** The default production parameters for key generation or key derivation.
0258  *
0259  * Calling psa_generate_key_ext() or psa_key_derivation_output_key_ext()
0260  * with `params=PSA_KEY_PRODUCTION_PARAMETERS_INIT` and
0261  * `params_data_length == 0` is equivalent to
0262  * calling psa_generate_key() or psa_key_derivation_output_key()
0263  * respectively.
0264  */
0265 #define PSA_KEY_PRODUCTION_PARAMETERS_INIT { 0 }
0266 #endif /* !__cplusplus */
0267 
0268 struct psa_key_policy_s {
0269     psa_key_usage_t MBEDTLS_PRIVATE(usage);
0270     psa_algorithm_t MBEDTLS_PRIVATE(alg);
0271     psa_algorithm_t MBEDTLS_PRIVATE(alg2);
0272 };
0273 typedef struct psa_key_policy_s psa_key_policy_t;
0274 
0275 #define PSA_KEY_POLICY_INIT { 0, 0, 0 }
0276 static inline struct psa_key_policy_s psa_key_policy_init(void)
0277 {
0278     const struct psa_key_policy_s v = PSA_KEY_POLICY_INIT;
0279     return v;
0280 }
0281 
0282 /* The type used internally for key sizes.
0283  * Public interfaces use size_t, but internally we use a smaller type. */
0284 typedef uint16_t psa_key_bits_t;
0285 /* The maximum value of the type used to represent bit-sizes.
0286  * This is used to mark an invalid key size. */
0287 #define PSA_KEY_BITS_TOO_LARGE          ((psa_key_bits_t) -1)
0288 /* The maximum size of a key in bits.
0289  * Currently defined as the maximum that can be represented, rounded down
0290  * to a whole number of bytes.
0291  * This is an uncast value so that it can be used in preprocessor
0292  * conditionals. */
0293 #define PSA_MAX_KEY_BITS 0xfff8
0294 
0295 struct psa_key_attributes_s {
0296 #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
0297     psa_key_slot_number_t MBEDTLS_PRIVATE(slot_number);
0298     int MBEDTLS_PRIVATE(has_slot_number);
0299 #endif /* MBEDTLS_PSA_CRYPTO_SE_C */
0300     psa_key_type_t MBEDTLS_PRIVATE(type);
0301     psa_key_bits_t MBEDTLS_PRIVATE(bits);
0302     psa_key_lifetime_t MBEDTLS_PRIVATE(lifetime);
0303     psa_key_policy_t MBEDTLS_PRIVATE(policy);
0304     /* This type has a different layout in the client view wrt the
0305      * service view of the key id, i.e. in service view usually is
0306      * expected to have MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER defined
0307      * thus adding an owner field to the standard psa_key_id_t. For
0308      * implementations with client/service separation, this means the
0309      * object will be marshalled through a transport channel and
0310      * interpreted differently at each side of the transport. Placing
0311      * it at the end of structures allows to interpret the structure
0312      * at the client without reorganizing the memory layout of the
0313      * struct
0314      */
0315     mbedtls_svc_key_id_t MBEDTLS_PRIVATE(id);
0316 };
0317 
0318 #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
0319 #define PSA_KEY_ATTRIBUTES_MAYBE_SLOT_NUMBER 0, 0,
0320 #else
0321 #define PSA_KEY_ATTRIBUTES_MAYBE_SLOT_NUMBER
0322 #endif
0323 #define PSA_KEY_ATTRIBUTES_INIT { PSA_KEY_ATTRIBUTES_MAYBE_SLOT_NUMBER \
0324                                       PSA_KEY_TYPE_NONE, 0,            \
0325                                       PSA_KEY_LIFETIME_VOLATILE,       \
0326                                       PSA_KEY_POLICY_INIT,             \
0327                                       MBEDTLS_SVC_KEY_ID_INIT }
0328 
0329 static inline struct psa_key_attributes_s psa_key_attributes_init(void)
0330 {
0331     const struct psa_key_attributes_s v = PSA_KEY_ATTRIBUTES_INIT;
0332     return v;
0333 }
0334 
0335 static inline void psa_set_key_id(psa_key_attributes_t *attributes,
0336                                   mbedtls_svc_key_id_t key)
0337 {
0338     psa_key_lifetime_t lifetime = attributes->MBEDTLS_PRIVATE(lifetime);
0339 
0340     attributes->MBEDTLS_PRIVATE(id) = key;
0341 
0342     if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) {
0343         attributes->MBEDTLS_PRIVATE(lifetime) =
0344             PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
0345                 PSA_KEY_LIFETIME_PERSISTENT,
0346                 PSA_KEY_LIFETIME_GET_LOCATION(lifetime));
0347     }
0348 }
0349 
0350 static inline mbedtls_svc_key_id_t psa_get_key_id(
0351     const psa_key_attributes_t *attributes)
0352 {
0353     return attributes->MBEDTLS_PRIVATE(id);
0354 }
0355 
0356 #ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
0357 static inline void mbedtls_set_key_owner_id(psa_key_attributes_t *attributes,
0358                                             mbedtls_key_owner_id_t owner)
0359 {
0360     attributes->MBEDTLS_PRIVATE(id).MBEDTLS_PRIVATE(owner) = owner;
0361 }
0362 #endif
0363 
0364 static inline void psa_set_key_lifetime(psa_key_attributes_t *attributes,
0365                                         psa_key_lifetime_t lifetime)
0366 {
0367     attributes->MBEDTLS_PRIVATE(lifetime) = lifetime;
0368     if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) {
0369 #ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
0370         attributes->MBEDTLS_PRIVATE(id).MBEDTLS_PRIVATE(key_id) = 0;
0371 #else
0372         attributes->MBEDTLS_PRIVATE(id) = 0;
0373 #endif
0374     }
0375 }
0376 
0377 static inline psa_key_lifetime_t psa_get_key_lifetime(
0378     const psa_key_attributes_t *attributes)
0379 {
0380     return attributes->MBEDTLS_PRIVATE(lifetime);
0381 }
0382 
0383 static inline void psa_extend_key_usage_flags(psa_key_usage_t *usage_flags)
0384 {
0385     if (*usage_flags & PSA_KEY_USAGE_SIGN_HASH) {
0386         *usage_flags |= PSA_KEY_USAGE_SIGN_MESSAGE;
0387     }
0388 
0389     if (*usage_flags & PSA_KEY_USAGE_VERIFY_HASH) {
0390         *usage_flags |= PSA_KEY_USAGE_VERIFY_MESSAGE;
0391     }
0392 }
0393 
0394 static inline void psa_set_key_usage_flags(psa_key_attributes_t *attributes,
0395                                            psa_key_usage_t usage_flags)
0396 {
0397     psa_extend_key_usage_flags(&usage_flags);
0398     attributes->MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(usage) = usage_flags;
0399 }
0400 
0401 static inline psa_key_usage_t psa_get_key_usage_flags(
0402     const psa_key_attributes_t *attributes)
0403 {
0404     return attributes->MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(usage);
0405 }
0406 
0407 static inline void psa_set_key_algorithm(psa_key_attributes_t *attributes,
0408                                          psa_algorithm_t alg)
0409 {
0410     attributes->MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg) = alg;
0411 }
0412 
0413 static inline psa_algorithm_t psa_get_key_algorithm(
0414     const psa_key_attributes_t *attributes)
0415 {
0416     return attributes->MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg);
0417 }
0418 
0419 static inline void psa_set_key_type(psa_key_attributes_t *attributes,
0420                                     psa_key_type_t type)
0421 {
0422     attributes->MBEDTLS_PRIVATE(type) = type;
0423 }
0424 
0425 static inline psa_key_type_t psa_get_key_type(
0426     const psa_key_attributes_t *attributes)
0427 {
0428     return attributes->MBEDTLS_PRIVATE(type);
0429 }
0430 
0431 static inline void psa_set_key_bits(psa_key_attributes_t *attributes,
0432                                     size_t bits)
0433 {
0434     if (bits > PSA_MAX_KEY_BITS) {
0435         attributes->MBEDTLS_PRIVATE(bits) = PSA_KEY_BITS_TOO_LARGE;
0436     } else {
0437         attributes->MBEDTLS_PRIVATE(bits) = (psa_key_bits_t) bits;
0438     }
0439 }
0440 
0441 static inline size_t psa_get_key_bits(
0442     const psa_key_attributes_t *attributes)
0443 {
0444     return attributes->MBEDTLS_PRIVATE(bits);
0445 }
0446 
0447 /**
0448  * \brief The context for PSA interruptible hash signing.
0449  */
0450 struct psa_sign_hash_interruptible_operation_s {
0451 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0452     mbedtls_psa_client_handle_t handle;
0453 #else
0454     /** Unique ID indicating which driver got assigned to do the
0455      * operation. Since driver contexts are driver-specific, swapping
0456      * drivers halfway through the operation is not supported.
0457      * ID values are auto-generated in psa_crypto_driver_wrappers.h
0458      * ID value zero means the context is not valid or not assigned to
0459      * any driver (i.e. none of the driver contexts are active). */
0460     unsigned int MBEDTLS_PRIVATE(id);
0461 
0462     psa_driver_sign_hash_interruptible_context_t MBEDTLS_PRIVATE(ctx);
0463 
0464     unsigned int MBEDTLS_PRIVATE(error_occurred) : 1;
0465 
0466     uint32_t MBEDTLS_PRIVATE(num_ops);
0467 #endif
0468 };
0469 
0470 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0471 #define PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT { 0 }
0472 #else
0473 #define PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT { 0, { 0 }, 0, 0 }
0474 #endif
0475 
0476 static inline struct psa_sign_hash_interruptible_operation_s
0477 psa_sign_hash_interruptible_operation_init(void)
0478 {
0479     const struct psa_sign_hash_interruptible_operation_s v =
0480         PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT;
0481 
0482     return v;
0483 }
0484 
0485 /**
0486  * \brief The context for PSA interruptible hash verification.
0487  */
0488 struct psa_verify_hash_interruptible_operation_s {
0489 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0490     mbedtls_psa_client_handle_t handle;
0491 #else
0492     /** Unique ID indicating which driver got assigned to do the
0493      * operation. Since driver contexts are driver-specific, swapping
0494      * drivers halfway through the operation is not supported.
0495      * ID values are auto-generated in psa_crypto_driver_wrappers.h
0496      * ID value zero means the context is not valid or not assigned to
0497      * any driver (i.e. none of the driver contexts are active). */
0498     unsigned int MBEDTLS_PRIVATE(id);
0499 
0500     psa_driver_verify_hash_interruptible_context_t MBEDTLS_PRIVATE(ctx);
0501 
0502     unsigned int MBEDTLS_PRIVATE(error_occurred) : 1;
0503 
0504     uint32_t MBEDTLS_PRIVATE(num_ops);
0505 #endif
0506 };
0507 
0508 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
0509 #define PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT { 0 }
0510 #else
0511 #define PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT { 0, { 0 }, 0, 0 }
0512 #endif
0513 
0514 static inline struct psa_verify_hash_interruptible_operation_s
0515 psa_verify_hash_interruptible_operation_init(void)
0516 {
0517     const struct psa_verify_hash_interruptible_operation_s v =
0518         PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT;
0519 
0520     return v;
0521 }
0522 
0523 #ifdef __cplusplus
0524 }
0525 #endif
0526 
0527 #endif /* PSA_CRYPTO_STRUCT_H */