blob: bee6895e8079b330e04c0e902c76b5b55cb9efae [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.
6 */
7/* Copyright The Mbed TLS Contributors
8 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 */
22
Steven Cooreman830aff22021-03-09 09:50:44 +010023#ifndef PSA_CRYPTO_DRIVER_CONTEXTS_H
24#define PSA_CRYPTO_DRIVER_CONTEXTS_H
Steven Cooremandbf8ced2021-03-04 13:01:18 +010025
26#include "psa/crypto.h"
27#include "psa/crypto_driver_common.h"
28
Steven Cooreman830aff22021-03-09 09:50:44 +010029/* Include the context structure definitions for those drivers that were
30 * declared during the autogeneration process. */
Steven Cooremandbf8ced2021-03-04 13:01:18 +010031
Steven Cooreman830aff22021-03-09 09:50:44 +010032/* Include the context structure definitions for the Mbed TLS software drivers */
Ronald Cron7cb9c3d2021-03-10 12:21:48 +010033#include "psa/crypto_builtin_cipher.h"
Ronald Cron9198e8c2021-03-17 14:29:56 +010034#include "psa/crypto_builtin_hash.h"
Steven Cooremandbf8ced2021-03-04 13:01:18 +010035
36/* Define the context to be used for an operation that is executed through the
37 * PSA Driver wrapper layer as the union of all possible driver's contexts.
38 *
39 * The union members are the driver's context structures, and the member names
40 * are formatted as `'drivername'_ctx`. This allows for procedural generation
41 * of both this file and the content of psa_crypto_driver_wrappers.c */
42
Steven Cooremanb1777312021-03-04 15:22:38 +010043typedef union {
Steven Cooremandbf8ced2021-03-04 13:01:18 +010044 unsigned dummy; /* Make sure this structure is always non-empty */
45 mbedtls_psa_hash_operation_t mbedtls_ctx;
Steven Cooremanf7638102021-03-04 15:14:36 +010046#if defined(PSA_CRYPTO_DRIVER_TEST)
Steven Cooreman0f8ffa82021-03-15 11:56:33 +010047 mbedtls_transparent_test_driver_hash_operation_t test_driver_ctx;
Steven Cooremanf7638102021-03-04 15:14:36 +010048#endif
Steven Cooremanb1777312021-03-04 15:22:38 +010049} psa_driver_hash_context_t;
Steven Cooremandbf8ced2021-03-04 13:01:18 +010050
Ronald Cron7cb9c3d2021-03-10 12:21:48 +010051typedef union {
52 unsigned dummy; /* Make sure this structure is always non-empty */
53 mbedtls_psa_cipher_operation_t mbedtls_ctx;
54#if defined(PSA_CRYPTO_DRIVER_TEST)
Ronald Cron9198e8c2021-03-17 14:29:56 +010055 mbedtls_transparent_test_driver_cipher_operation_t transparent_test_driver_ctx;
56 mbedtls_opaque_test_driver_cipher_operation_t opaque_test_driver_ctx;
Ronald Cron7cb9c3d2021-03-10 12:21:48 +010057#endif
58} psa_driver_cipher_context_t;
59
Steven Cooreman830aff22021-03-09 09:50:44 +010060#endif /* PSA_CRYPTO_DRIVER_CONTEXTS_H */
Steven Cooremandbf8ced2021-03-04 13:01:18 +010061/* End of automatically generated file. */