Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  *  Declaration of context structures for use with the PSA driver wrapper
0003  *  interface. This file contains the context structures for 'composite'
0004  *  operations, i.e. those operations which need to make use of other operations
0005  *  from the primitives (crypto_driver_contexts_primitives.h)
0006  *
0007  *  Warning: This file will be auto-generated in the future.
0008  *
0009  * \note This file may not be included directly. Applications must
0010  * include psa/crypto.h.
0011  *
0012  * \note This header and its content are not part of the Mbed TLS API and
0013  * applications must not depend on it. Its main purpose is to define the
0014  * multi-part state objects of the PSA drivers included in the cryptographic
0015  * library. The definitions of these objects are then used by crypto_struct.h
0016  * to define the implementation-defined types of PSA multi-part state objects.
0017  */
0018 /*  Copyright The Mbed TLS Contributors
0019  *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
0020  */
0021 
0022 #ifndef PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H
0023 #define PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H
0024 
0025 #include "psa/crypto_driver_common.h"
0026 
0027 /* Include the context structure definitions for the Mbed TLS software drivers */
0028 #include "psa/crypto_builtin_composites.h"
0029 
0030 /* Include the context structure definitions for those drivers that were
0031  * declared during the autogeneration process. */
0032 
0033 #if defined(MBEDTLS_TEST_LIBTESTDRIVER1)
0034 #include <libtestdriver1/include/psa/crypto.h>
0035 #endif
0036 
0037 #if defined(PSA_CRYPTO_DRIVER_TEST)
0038 #if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
0039     defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_MAC)
0040 typedef libtestdriver1_mbedtls_psa_mac_operation_t
0041     mbedtls_transparent_test_driver_mac_operation_t;
0042 typedef libtestdriver1_mbedtls_psa_mac_operation_t
0043     mbedtls_opaque_test_driver_mac_operation_t;
0044 
0045 #define MBEDTLS_TRANSPARENT_TEST_DRIVER_MAC_OPERATION_INIT \
0046     LIBTESTDRIVER1_MBEDTLS_PSA_MAC_OPERATION_INIT
0047 #define MBEDTLS_OPAQUE_TEST_DRIVER_MAC_OPERATION_INIT \
0048     LIBTESTDRIVER1_MBEDTLS_PSA_MAC_OPERATION_INIT
0049 
0050 #else
0051 typedef mbedtls_psa_mac_operation_t
0052     mbedtls_transparent_test_driver_mac_operation_t;
0053 typedef mbedtls_psa_mac_operation_t
0054     mbedtls_opaque_test_driver_mac_operation_t;
0055 
0056 #define MBEDTLS_TRANSPARENT_TEST_DRIVER_MAC_OPERATION_INIT \
0057     MBEDTLS_PSA_MAC_OPERATION_INIT
0058 #define MBEDTLS_OPAQUE_TEST_DRIVER_MAC_OPERATION_INIT \
0059     MBEDTLS_PSA_MAC_OPERATION_INIT
0060 
0061 #endif /* MBEDTLS_TEST_LIBTESTDRIVER1 && LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_MAC */
0062 
0063 #if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
0064     defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_AEAD)
0065 typedef libtestdriver1_mbedtls_psa_aead_operation_t
0066     mbedtls_transparent_test_driver_aead_operation_t;
0067 
0068 #define MBEDTLS_TRANSPARENT_TEST_DRIVER_AEAD_OPERATION_INIT \
0069     LIBTESTDRIVER1_MBEDTLS_PSA_AEAD_OPERATION_INIT
0070 #else
0071 typedef mbedtls_psa_aead_operation_t
0072     mbedtls_transparent_test_driver_aead_operation_t;
0073 
0074 #define MBEDTLS_TRANSPARENT_TEST_DRIVER_AEAD_OPERATION_INIT \
0075     MBEDTLS_PSA_AEAD_OPERATION_INIT
0076 
0077 #endif /* MBEDTLS_TEST_LIBTESTDRIVER1 && LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_AEAD */
0078 
0079 #if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
0080     defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_PAKE)
0081 
0082 typedef libtestdriver1_mbedtls_psa_pake_operation_t
0083     mbedtls_transparent_test_driver_pake_operation_t;
0084 typedef libtestdriver1_mbedtls_psa_pake_operation_t
0085     mbedtls_opaque_test_driver_pake_operation_t;
0086 
0087 #define MBEDTLS_TRANSPARENT_TEST_DRIVER_PAKE_OPERATION_INIT \
0088     LIBTESTDRIVER1_MBEDTLS_PSA_PAKE_OPERATION_INIT
0089 #define MBEDTLS_OPAQUE_TEST_DRIVER_PAKE_OPERATION_INIT \
0090     LIBTESTDRIVER1_MBEDTLS_PSA_PAKE_OPERATION_INIT
0091 
0092 #else
0093 typedef mbedtls_psa_pake_operation_t
0094     mbedtls_transparent_test_driver_pake_operation_t;
0095 typedef mbedtls_psa_pake_operation_t
0096     mbedtls_opaque_test_driver_pake_operation_t;
0097 
0098 #define MBEDTLS_TRANSPARENT_TEST_DRIVER_PAKE_OPERATION_INIT \
0099     MBEDTLS_PSA_PAKE_OPERATION_INIT
0100 #define MBEDTLS_OPAQUE_TEST_DRIVER_PAKE_OPERATION_INIT \
0101     MBEDTLS_PSA_PAKE_OPERATION_INIT
0102 
0103 #endif /* MBEDTLS_TEST_LIBTESTDRIVER1 && LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_PAKE */
0104 
0105 #endif /* PSA_CRYPTO_DRIVER_TEST */
0106 
0107 /* Define the context to be used for an operation that is executed through the
0108  * PSA Driver wrapper layer as the union of all possible driver's contexts.
0109  *
0110  * The union members are the driver's context structures, and the member names
0111  * are formatted as `'drivername'_ctx`. This allows for procedural generation
0112  * of both this file and the content of psa_crypto_driver_wrappers.h */
0113 
0114 typedef union {
0115     unsigned dummy; /* Make sure this union is always non-empty */
0116     mbedtls_psa_mac_operation_t mbedtls_ctx;
0117 #if defined(PSA_CRYPTO_DRIVER_TEST)
0118     mbedtls_transparent_test_driver_mac_operation_t transparent_test_driver_ctx;
0119     mbedtls_opaque_test_driver_mac_operation_t opaque_test_driver_ctx;
0120 #endif
0121 } psa_driver_mac_context_t;
0122 
0123 typedef union {
0124     unsigned dummy; /* Make sure this union is always non-empty */
0125     mbedtls_psa_aead_operation_t mbedtls_ctx;
0126 #if defined(PSA_CRYPTO_DRIVER_TEST)
0127     mbedtls_transparent_test_driver_aead_operation_t transparent_test_driver_ctx;
0128 #endif
0129 } psa_driver_aead_context_t;
0130 
0131 typedef union {
0132     unsigned dummy; /* Make sure this union is always non-empty */
0133     mbedtls_psa_sign_hash_interruptible_operation_t mbedtls_ctx;
0134 } psa_driver_sign_hash_interruptible_context_t;
0135 
0136 typedef union {
0137     unsigned dummy; /* Make sure this union is always non-empty */
0138     mbedtls_psa_verify_hash_interruptible_operation_t mbedtls_ctx;
0139 } psa_driver_verify_hash_interruptible_context_t;
0140 
0141 typedef union {
0142     unsigned dummy; /* Make sure this union is always non-empty */
0143     mbedtls_psa_pake_operation_t mbedtls_ctx;
0144 #if defined(PSA_CRYPTO_DRIVER_TEST)
0145     mbedtls_transparent_test_driver_pake_operation_t transparent_test_driver_ctx;
0146     mbedtls_opaque_test_driver_pake_operation_t opaque_test_driver_ctx;
0147 #endif
0148 } psa_driver_pake_context_t;
0149 
0150 #endif /* PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H */
0151 /* End of automatically generated file. */