blob: d725e8440f43473f760a561bc5281039ec1a9703 [file] [log] [blame]
Steven Cooremandbf8ced2021-03-04 13:01:18 +01001/*
2 * Declaration of context structures for use with the PSA driver wrapper
3 * interface.
4 *
5 * Warning: This file will be auto-generated in the future.
Ronald Crondd3b5392021-04-01 15:36:50 +02006 *
7 * \note This file may not be included directly. Applications must
8 * include psa/crypto.h.
9 *
10 * \note This header and its content is not part of the Mbed TLS API and
11 * applications must not depend on it. Its main purpose is to define the
12 * multi-part state objects of the PSA drivers included in the cryptographic
13 * library. The definition of these objects are then used by crypto_struct.h
14 * to define the implementation-defined types of PSA multi-part state objects.
Steven Cooremandbf8ced2021-03-04 13:01:18 +010015 */
16/* Copyright The Mbed TLS Contributors
17 * SPDX-License-Identifier: Apache-2.0
18 *
19 * Licensed under the Apache License, Version 2.0 (the "License"); you may
20 * not use this file except in compliance with the License.
21 * You may obtain a copy of the License at
22 *
23 * http://www.apache.org/licenses/LICENSE-2.0
24 *
25 * Unless required by applicable law or agreed to in writing, software
26 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
27 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 * See the License for the specific language governing permissions and
29 * limitations under the License.
30 */
31
Steven Cooreman830aff22021-03-09 09:50:44 +010032#ifndef PSA_CRYPTO_DRIVER_CONTEXTS_H
33#define PSA_CRYPTO_DRIVER_CONTEXTS_H
Steven Cooremandbf8ced2021-03-04 13:01:18 +010034
35#include "psa/crypto.h"
36#include "psa/crypto_driver_common.h"
37
Steven Cooreman830aff22021-03-09 09:50:44 +010038/* Include the context structure definitions for those drivers that were
39 * declared during the autogeneration process. */
Steven Cooremandbf8ced2021-03-04 13:01:18 +010040
Steven Cooreman830aff22021-03-09 09:50:44 +010041/* Include the context structure definitions for the Mbed TLS software drivers */
Ronald Cron06c84ca2021-04-01 11:58:25 +020042#include "psa/crypto_builtin.h"
Steven Cooremandbf8ced2021-03-04 13:01:18 +010043
44/* Define the context to be used for an operation that is executed through the
45 * PSA Driver wrapper layer as the union of all possible driver's contexts.
46 *
47 * The union members are the driver's context structures, and the member names
48 * are formatted as `'drivername'_ctx`. This allows for procedural generation
49 * of both this file and the content of psa_crypto_driver_wrappers.c */
50
Steven Cooremanb1777312021-03-04 15:22:38 +010051typedef union {
Ronald Crone31fd112021-04-01 10:47:14 +020052 unsigned dummy; /* Make sure this union is always non-empty */
Steven Cooremandbf8ced2021-03-04 13:01:18 +010053 mbedtls_psa_hash_operation_t mbedtls_ctx;
Steven Cooremanf7638102021-03-04 15:14:36 +010054#if defined(PSA_CRYPTO_DRIVER_TEST)
Steven Cooreman0f8ffa82021-03-15 11:56:33 +010055 mbedtls_transparent_test_driver_hash_operation_t test_driver_ctx;
Steven Cooremanf7638102021-03-04 15:14:36 +010056#endif
Steven Cooremanb1777312021-03-04 15:22:38 +010057} psa_driver_hash_context_t;
Steven Cooremandbf8ced2021-03-04 13:01:18 +010058
Ronald Cron7cb9c3d2021-03-10 12:21:48 +010059typedef union {
Ronald Crone31fd112021-04-01 10:47:14 +020060 unsigned dummy; /* Make sure this union is always non-empty */
Ronald Cron7cb9c3d2021-03-10 12:21:48 +010061 mbedtls_psa_cipher_operation_t mbedtls_ctx;
62#if defined(PSA_CRYPTO_DRIVER_TEST)
Ronald Cron9198e8c2021-03-17 14:29:56 +010063 mbedtls_transparent_test_driver_cipher_operation_t transparent_test_driver_ctx;
64 mbedtls_opaque_test_driver_cipher_operation_t opaque_test_driver_ctx;
Ronald Cron7cb9c3d2021-03-10 12:21:48 +010065#endif
66} psa_driver_cipher_context_t;
67
Steven Cooreman830aff22021-03-09 09:50:44 +010068#endif /* PSA_CRYPTO_DRIVER_CONTEXTS_H */
Steven Cooremandbf8ced2021-03-04 13:01:18 +010069/* End of automatically generated file. */