File indexing completed on 2025-08-27 09:43:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
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
0028 #include "psa/crypto_builtin_composites.h"
0029
0030
0031
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
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
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
0104
0105 #endif
0106
0107
0108
0109
0110
0111
0112
0113
0114 typedef union {
0115 unsigned dummy;
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;
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;
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;
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;
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
0151