Path: blob/master/thirdparty/mbedtls/include/psa/crypto_driver_contexts_primitives.h
9904 views
/*1* Declaration of context structures for use with the PSA driver wrapper2* interface. This file contains the context structures for 'primitive'3* operations, i.e. those operations which do not rely on other contexts.4*5* Warning: This file will be auto-generated in the future.6*7* \note This file may not be included directly. Applications must8* include psa/crypto.h.9*10* \note This header and its content are not part of the Mbed TLS API and11* applications must not depend on it. Its main purpose is to define the12* multi-part state objects of the PSA drivers included in the cryptographic13* library. The definitions of these objects are then used by crypto_struct.h14* to define the implementation-defined types of PSA multi-part state objects.15*/16/* Copyright The Mbed TLS Contributors17* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later18*/1920#ifndef PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H21#define PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H2223#include "psa/crypto_driver_common.h"2425/* Include the context structure definitions for the Mbed TLS software drivers */26#include "psa/crypto_builtin_primitives.h"2728/* Include the context structure definitions for those drivers that were29* declared during the autogeneration process. */3031#if defined(MBEDTLS_TEST_LIBTESTDRIVER1)32#include <libtestdriver1/include/psa/crypto.h>33#endif3435#if defined(PSA_CRYPTO_DRIVER_TEST)3637#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \38defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_CIPHER)39typedef libtestdriver1_mbedtls_psa_cipher_operation_t40mbedtls_transparent_test_driver_cipher_operation_t;4142#define MBEDTLS_TRANSPARENT_TEST_DRIVER_CIPHER_OPERATION_INIT \43LIBTESTDRIVER1_MBEDTLS_PSA_CIPHER_OPERATION_INIT44#else45typedef mbedtls_psa_cipher_operation_t46mbedtls_transparent_test_driver_cipher_operation_t;4748#define MBEDTLS_TRANSPARENT_TEST_DRIVER_CIPHER_OPERATION_INIT \49MBEDTLS_PSA_CIPHER_OPERATION_INIT50#endif /* MBEDTLS_TEST_LIBTESTDRIVER1 &&51LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_CIPHER */5253#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \54defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_HASH)55typedef libtestdriver1_mbedtls_psa_hash_operation_t56mbedtls_transparent_test_driver_hash_operation_t;5758#define MBEDTLS_TRANSPARENT_TEST_DRIVER_HASH_OPERATION_INIT \59LIBTESTDRIVER1_MBEDTLS_PSA_HASH_OPERATION_INIT60#else61typedef mbedtls_psa_hash_operation_t62mbedtls_transparent_test_driver_hash_operation_t;6364#define MBEDTLS_TRANSPARENT_TEST_DRIVER_HASH_OPERATION_INIT \65MBEDTLS_PSA_HASH_OPERATION_INIT66#endif /* MBEDTLS_TEST_LIBTESTDRIVER1 &&67LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_HASH */6869typedef struct {70unsigned int initialised : 1;71mbedtls_transparent_test_driver_cipher_operation_t ctx;72} mbedtls_opaque_test_driver_cipher_operation_t;7374#define MBEDTLS_OPAQUE_TEST_DRIVER_CIPHER_OPERATION_INIT \75{ 0, MBEDTLS_TRANSPARENT_TEST_DRIVER_CIPHER_OPERATION_INIT }7677#endif /* PSA_CRYPTO_DRIVER_TEST */7879/* Define the context to be used for an operation that is executed through the80* PSA Driver wrapper layer as the union of all possible driver's contexts.81*82* The union members are the driver's context structures, and the member names83* are formatted as `'drivername'_ctx`. This allows for procedural generation84* of both this file and the content of psa_crypto_driver_wrappers.h */8586typedef union {87unsigned dummy; /* Make sure this union is always non-empty */88mbedtls_psa_hash_operation_t mbedtls_ctx;89#if defined(PSA_CRYPTO_DRIVER_TEST)90mbedtls_transparent_test_driver_hash_operation_t test_driver_ctx;91#endif92} psa_driver_hash_context_t;9394typedef union {95unsigned dummy; /* Make sure this union is always non-empty */96mbedtls_psa_cipher_operation_t mbedtls_ctx;97#if defined(PSA_CRYPTO_DRIVER_TEST)98mbedtls_transparent_test_driver_cipher_operation_t transparent_test_driver_ctx;99mbedtls_opaque_test_driver_cipher_operation_t opaque_test_driver_ctx;100#endif101} psa_driver_cipher_context_t;102103#endif /* PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H */104/* End of automatically generated file. */105106107