| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 1 | /* | 
|  | 2 | *  Declaration of context structures for use with the PSA driver wrapper | 
| Steven Cooreman | 675501d | 2021-04-26 11:54:58 +0200 | [diff] [blame] | 3 | *  interface. This file contains the context structures for 'primitive' | 
|  | 4 | *  operations, i.e. those operations which do not rely on other contexts. | 
| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 5 | * | 
|  | 6 | *  Warning: This file will be auto-generated in the future. | 
| Ronald Cron | dd3b539 | 2021-04-01 15:36:50 +0200 | [diff] [blame] | 7 | * | 
|  | 8 | * \note This file may not be included directly. Applications must | 
|  | 9 | * include psa/crypto.h. | 
|  | 10 | * | 
|  | 11 | * \note This header and its content is not part of the Mbed TLS API and | 
|  | 12 | * applications must not depend on it. Its main purpose is to define the | 
|  | 13 | * multi-part state objects of the PSA drivers included in the cryptographic | 
|  | 14 | * library. The definition of these objects are then used by crypto_struct.h | 
|  | 15 | * to define the implementation-defined types of PSA multi-part state objects. | 
| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 16 | */ | 
|  | 17 | /*  Copyright The Mbed TLS Contributors | 
|  | 18 | *  SPDX-License-Identifier: Apache-2.0 | 
|  | 19 | * | 
|  | 20 | *  Licensed under the Apache License, Version 2.0 (the "License"); you may | 
|  | 21 | *  not use this file except in compliance with the License. | 
|  | 22 | *  You may obtain a copy of the License at | 
|  | 23 | * | 
|  | 24 | *  http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 25 | * | 
|  | 26 | *  Unless required by applicable law or agreed to in writing, software | 
|  | 27 | *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | 28 | *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 29 | *  See the License for the specific language governing permissions and | 
|  | 30 | *  limitations under the License. | 
|  | 31 | */ | 
|  | 32 |  | 
| Steven Cooreman | 675501d | 2021-04-26 11:54:58 +0200 | [diff] [blame] | 33 | #ifndef PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H | 
|  | 34 | #define PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H | 
| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 35 |  | 
| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 36 | #include "psa/crypto_driver_common.h" | 
|  | 37 |  | 
| Steven Cooreman | 830aff2 | 2021-03-09 09:50:44 +0100 | [diff] [blame] | 38 | /* Include the context structure definitions for those drivers that were | 
|  | 39 | * declared during the autogeneration process. */ | 
| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 40 |  | 
| Steven Cooreman | 830aff2 | 2021-03-09 09:50:44 +0100 | [diff] [blame] | 41 | /* Include the context structure definitions for the Mbed TLS software drivers */ | 
| Steven Cooreman | 675501d | 2021-04-26 11:54:58 +0200 | [diff] [blame] | 42 | #include "psa/crypto_builtin_primitives.h" | 
| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 43 |  | 
|  | 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 Cooreman | b177731 | 2021-03-04 15:22:38 +0100 | [diff] [blame] | 51 | typedef union { | 
| Ronald Cron | e31fd11 | 2021-04-01 10:47:14 +0200 | [diff] [blame] | 52 | unsigned dummy; /* Make sure this union is always non-empty */ | 
| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 53 | mbedtls_psa_hash_operation_t mbedtls_ctx; | 
| Steven Cooreman | f763810 | 2021-03-04 15:14:36 +0100 | [diff] [blame] | 54 | #if defined(PSA_CRYPTO_DRIVER_TEST) | 
| Steven Cooreman | 0f8ffa8 | 2021-03-15 11:56:33 +0100 | [diff] [blame] | 55 | mbedtls_transparent_test_driver_hash_operation_t test_driver_ctx; | 
| Steven Cooreman | f763810 | 2021-03-04 15:14:36 +0100 | [diff] [blame] | 56 | #endif | 
| Steven Cooreman | b177731 | 2021-03-04 15:22:38 +0100 | [diff] [blame] | 57 | } psa_driver_hash_context_t; | 
| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 58 |  | 
| Ronald Cron | 7cb9c3d | 2021-03-10 12:21:48 +0100 | [diff] [blame] | 59 | typedef union { | 
| Ronald Cron | e31fd11 | 2021-04-01 10:47:14 +0200 | [diff] [blame] | 60 | unsigned dummy; /* Make sure this union is always non-empty */ | 
| Ronald Cron | 7cb9c3d | 2021-03-10 12:21:48 +0100 | [diff] [blame] | 61 | mbedtls_psa_cipher_operation_t mbedtls_ctx; | 
|  | 62 | #if defined(PSA_CRYPTO_DRIVER_TEST) | 
| Ronald Cron | 9198e8c | 2021-03-17 14:29:56 +0100 | [diff] [blame] | 63 | mbedtls_transparent_test_driver_cipher_operation_t transparent_test_driver_ctx; | 
|  | 64 | mbedtls_opaque_test_driver_cipher_operation_t opaque_test_driver_ctx; | 
| Ronald Cron | 7cb9c3d | 2021-03-10 12:21:48 +0100 | [diff] [blame] | 65 | #endif | 
|  | 66 | } psa_driver_cipher_context_t; | 
|  | 67 |  | 
| Steven Cooreman | 675501d | 2021-04-26 11:54:58 +0200 | [diff] [blame] | 68 | #endif /* PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H */ | 
| Steven Cooreman | dbf8ced | 2021-03-04 13:01:18 +0100 | [diff] [blame] | 69 | /* End of automatically generated file. */ |