Path: blob/master/thirdparty/mbedtls/include/psa/crypto_driver_contexts_composites.h
9904 views
/*1* Declaration of context structures for use with the PSA driver wrapper2* interface. This file contains the context structures for 'composite'3* operations, i.e. those operations which need to make use of other operations4* from the primitives (crypto_driver_contexts_primitives.h)5*6* Warning: This file will be auto-generated in the future.7*8* \note This file may not be included directly. Applications must9* include psa/crypto.h.10*11* \note This header and its content are not part of the Mbed TLS API and12* applications must not depend on it. Its main purpose is to define the13* multi-part state objects of the PSA drivers included in the cryptographic14* library. The definitions of these objects are then used by crypto_struct.h15* to define the implementation-defined types of PSA multi-part state objects.16*/17/* Copyright The Mbed TLS Contributors18* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later19*/2021#ifndef PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H22#define PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H2324#include "psa/crypto_driver_common.h"2526/* Include the context structure definitions for the Mbed TLS software drivers */27#include "psa/crypto_builtin_composites.h"2829/* Include the context structure definitions for those drivers that were30* declared during the autogeneration process. */3132#if defined(MBEDTLS_TEST_LIBTESTDRIVER1)33#include <libtestdriver1/include/psa/crypto.h>34#endif3536#if defined(PSA_CRYPTO_DRIVER_TEST)37#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \38defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_MAC)39typedef libtestdriver1_mbedtls_psa_mac_operation_t40mbedtls_transparent_test_driver_mac_operation_t;41typedef libtestdriver1_mbedtls_psa_mac_operation_t42mbedtls_opaque_test_driver_mac_operation_t;4344#define MBEDTLS_TRANSPARENT_TEST_DRIVER_MAC_OPERATION_INIT \45LIBTESTDRIVER1_MBEDTLS_PSA_MAC_OPERATION_INIT46#define MBEDTLS_OPAQUE_TEST_DRIVER_MAC_OPERATION_INIT \47LIBTESTDRIVER1_MBEDTLS_PSA_MAC_OPERATION_INIT4849#else50typedef mbedtls_psa_mac_operation_t51mbedtls_transparent_test_driver_mac_operation_t;52typedef mbedtls_psa_mac_operation_t53mbedtls_opaque_test_driver_mac_operation_t;5455#define MBEDTLS_TRANSPARENT_TEST_DRIVER_MAC_OPERATION_INIT \56MBEDTLS_PSA_MAC_OPERATION_INIT57#define MBEDTLS_OPAQUE_TEST_DRIVER_MAC_OPERATION_INIT \58MBEDTLS_PSA_MAC_OPERATION_INIT5960#endif /* MBEDTLS_TEST_LIBTESTDRIVER1 && LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_MAC */6162#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \63defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_AEAD)64typedef libtestdriver1_mbedtls_psa_aead_operation_t65mbedtls_transparent_test_driver_aead_operation_t;6667#define MBEDTLS_TRANSPARENT_TEST_DRIVER_AEAD_OPERATION_INIT \68LIBTESTDRIVER1_MBEDTLS_PSA_AEAD_OPERATION_INIT69#else70typedef mbedtls_psa_aead_operation_t71mbedtls_transparent_test_driver_aead_operation_t;7273#define MBEDTLS_TRANSPARENT_TEST_DRIVER_AEAD_OPERATION_INIT \74MBEDTLS_PSA_AEAD_OPERATION_INIT7576#endif /* MBEDTLS_TEST_LIBTESTDRIVER1 && LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_AEAD */7778#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \79defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_PAKE)8081typedef libtestdriver1_mbedtls_psa_pake_operation_t82mbedtls_transparent_test_driver_pake_operation_t;83typedef libtestdriver1_mbedtls_psa_pake_operation_t84mbedtls_opaque_test_driver_pake_operation_t;8586#define MBEDTLS_TRANSPARENT_TEST_DRIVER_PAKE_OPERATION_INIT \87LIBTESTDRIVER1_MBEDTLS_PSA_PAKE_OPERATION_INIT88#define MBEDTLS_OPAQUE_TEST_DRIVER_PAKE_OPERATION_INIT \89LIBTESTDRIVER1_MBEDTLS_PSA_PAKE_OPERATION_INIT9091#else92typedef mbedtls_psa_pake_operation_t93mbedtls_transparent_test_driver_pake_operation_t;94typedef mbedtls_psa_pake_operation_t95mbedtls_opaque_test_driver_pake_operation_t;9697#define MBEDTLS_TRANSPARENT_TEST_DRIVER_PAKE_OPERATION_INIT \98MBEDTLS_PSA_PAKE_OPERATION_INIT99#define MBEDTLS_OPAQUE_TEST_DRIVER_PAKE_OPERATION_INIT \100MBEDTLS_PSA_PAKE_OPERATION_INIT101102#endif /* MBEDTLS_TEST_LIBTESTDRIVER1 && LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_PAKE */103104#endif /* PSA_CRYPTO_DRIVER_TEST */105106/* Define the context to be used for an operation that is executed through the107* PSA Driver wrapper layer as the union of all possible driver's contexts.108*109* The union members are the driver's context structures, and the member names110* are formatted as `'drivername'_ctx`. This allows for procedural generation111* of both this file and the content of psa_crypto_driver_wrappers.h */112113typedef union {114unsigned dummy; /* Make sure this union is always non-empty */115mbedtls_psa_mac_operation_t mbedtls_ctx;116#if defined(PSA_CRYPTO_DRIVER_TEST)117mbedtls_transparent_test_driver_mac_operation_t transparent_test_driver_ctx;118mbedtls_opaque_test_driver_mac_operation_t opaque_test_driver_ctx;119#endif120} psa_driver_mac_context_t;121122typedef union {123unsigned dummy; /* Make sure this union is always non-empty */124mbedtls_psa_aead_operation_t mbedtls_ctx;125#if defined(PSA_CRYPTO_DRIVER_TEST)126mbedtls_transparent_test_driver_aead_operation_t transparent_test_driver_ctx;127#endif128} psa_driver_aead_context_t;129130typedef union {131unsigned dummy; /* Make sure this union is always non-empty */132mbedtls_psa_sign_hash_interruptible_operation_t mbedtls_ctx;133} psa_driver_sign_hash_interruptible_context_t;134135typedef union {136unsigned dummy; /* Make sure this union is always non-empty */137mbedtls_psa_verify_hash_interruptible_operation_t mbedtls_ctx;138} psa_driver_verify_hash_interruptible_context_t;139140typedef union {141unsigned dummy; /* Make sure this union is always non-empty */142mbedtls_psa_pake_operation_t mbedtls_ctx;143#if defined(PSA_CRYPTO_DRIVER_TEST)144mbedtls_transparent_test_driver_pake_operation_t transparent_test_driver_ctx;145mbedtls_opaque_test_driver_pake_operation_t opaque_test_driver_ctx;146#endif147} psa_driver_pake_context_t;148149#endif /* PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H */150/* End of automatically generated file. */151152153