MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
crypto_driver_contexts_primitives.h
1/*
2 * Declaration of context structures for use with the PSA driver wrapper
3 * interface. This file contains the context structures for 'primitive'
4 * operations, i.e. those operations which do not rely on other contexts.
5 *
6 * Warning: This file will be auto-generated in the future.
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.
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
33#ifndef PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H
34#define PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H
35
36#include "crypto_driver_common.h"
37
38/* Include the context structure definitions for the Mbed TLS software drivers */
39#include "crypto_builtin_primitives.h"
40#include "els_pkc_crypto_primitives.h"
41
42/* Include CLNS header files */
43#include <mcuxClPsaDriver_MemoryConsumption.h>
44#include <mcuxClKey.h>
45#include <mcuxClCipher.h>
46#include <mcuxClCipherModes.h>
47#include <mcuxClHash.h>
48
49
50/* Include the context structure definitions for those drivers that were
51 * declared during the autogeneration process. */
52
53#if defined(MBEDTLS_TEST_LIBTESTDRIVER1)
54#include <libtestdriver1/include/psa/crypto.h>
55#endif
56
57#if defined(PSA_CRYPTO_DRIVER_TEST)
58
59#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
60 defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_CIPHER)
61typedef libtestdriver1_mbedtls_psa_cipher_operation_t
62 mbedtls_transparent_test_driver_cipher_operation_t;
63
64#define MBEDTLS_TRANSPARENT_TEST_DRIVER_CIPHER_OPERATION_INIT \
65 LIBTESTDRIVER1_MBEDTLS_PSA_CIPHER_OPERATION_INIT
66#else
67typedef mbedtls_psa_cipher_operation_t
68 mbedtls_transparent_test_driver_cipher_operation_t;
69
70#define MBEDTLS_TRANSPARENT_TEST_DRIVER_CIPHER_OPERATION_INIT \
71 MBEDTLS_PSA_CIPHER_OPERATION_INIT
72#endif /* MBEDTLS_TEST_LIBTESTDRIVER1 &&
73 LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_CIPHER */
74
75#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
76 defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_HASH)
77typedef libtestdriver1_mbedtls_psa_hash_operation_t
78 mbedtls_transparent_test_driver_hash_operation_t;
79
80#define MBEDTLS_TRANSPARENT_TEST_DRIVER_HASH_OPERATION_INIT \
81 LIBTESTDRIVER1_MBEDTLS_PSA_HASH_OPERATION_INIT
82#else
83typedef mbedtls_psa_hash_operation_t
84 mbedtls_transparent_test_driver_hash_operation_t;
85
86#define MBEDTLS_TRANSPARENT_TEST_DRIVER_HASH_OPERATION_INIT \
87 MBEDTLS_PSA_HASH_OPERATION_INIT
88#endif /* MBEDTLS_TEST_LIBTESTDRIVER1 &&
89 LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_HASH */
90
91typedef struct {
92 unsigned int initialised : 1;
93 mbedtls_transparent_test_driver_cipher_operation_t ctx;
94} mbedtls_opaque_test_driver_cipher_operation_t;
95
96#define MBEDTLS_OPAQUE_TEST_DRIVER_CIPHER_OPERATION_INIT \
97 { 0, MBEDTLS_TRANSPARENT_TEST_DRIVER_CIPHER_OPERATION_INIT }
98
99#endif /* PSA_CRYPTO_DRIVER_TEST */
100
101/* Define the context to be used for an operation that is executed through the
102 * PSA Driver wrapper layer as the union of all possible driver's contexts.
103 *
104 * The union members are the driver's context structures, and the member names
105 * are formatted as `'drivername'_ctx`. This allows for procedural generation
106 * of both this file and the content of psa_crypto_driver_wrappers.c */
107
108typedef union {
109 unsigned dummy; /* Make sure this union is always non-empty */
110 mbedtls_psa_hash_operation_t mbedtls_ctx;
111
112 els_pkc_hash_operation_t els_pkc_driver_ctx;
114
115typedef union {
116 unsigned dummy; /* Make sure this union is always non-empty */
117 mbedtls_psa_cipher_operation_t mbedtls_ctx;
118 els_pkc_cipher_operation_t els_pkc_driver_ctx;
120
121#endif /* PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H */
122/* End of automatically generated file. */
Top-level include file for the mcuxClCipher component.
Top-level include file for the mcuxClHash component.
Top-level include file for the mcuxClKey component.
Definition crypto_driver_contexts_primitives.h:108
Definition crypto_driver_contexts_primitives.h:115
Definition els_pkc_crypto_primitives.h:26
Definition els_pkc_crypto_primitives.h:30