nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
crypto_driver_contexts_composites.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022-2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7/*
8 * Declaration of context structures for use with the PSA driver wrapper
9 * interface. This file contains the context structures for 'composite'
10 * operations, i.e. those operations which need to make use of other operations
11 * from the primitives (crypto_driver_contexts_primitives.h)
12 *
13 * Warning: This file will be auto-generated in the future.
14 *
15 * \note This file may not be included directly. Applications must
16 * include psa/crypto.h.
17 *
18 * \note This header and its content is not part of the Mbed TLS API and
19 * applications must not depend on it. Its main purpose is to define the
20 * multi-part state objects of the PSA drivers included in the cryptographic
21 * library. The definition of these objects are then used by crypto_struct.h
22 * to define the implementation-defined types of PSA multi-part state objects.
23 */
24
25#ifndef PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H
26#define PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H
27
28#include <tf_psa_crypto_common.h>
29
30#include "psa/crypto_driver_common.h"
31
32/* Include the context structure definitions for those drivers that were
33 * declared during the autogeneration process.
34 */
35#if defined(PSA_NEED_CC3XX_MAC_DRIVER) || defined(PSA_NEED_CC3XX_AEAD_DRIVER)
36#include "cc3xx_crypto_primitives.h"
37#elif defined(PSA_CRYPTO_DRIVER_CRACEN)
39#endif
40
41#if defined(PSA_NEED_OBERON_AEAD_DRIVER)
42#include "oberon_aead.h"
43#endif
44#if defined(PSA_NEED_OBERON_MAC_DRIVER)
45#include "oberon_mac.h"
46#endif
47
48/* Define the context to be used for an operation that is executed through the
49 * PSA Driver wrapper layer as the union of all possible driver's contexts.
50 *
51 * The union members are the driver's context structures, and the member names
52 * are formatted as `'drivername'_ctx`. This allows for procedural generation
53 * of both this file and the content of psa_crypto_driver_wrappers.c
54 */
55
56typedef union {
57 unsigned int dummy; /* Make sure this union is always non-empty */
58#if defined(PSA_NEED_CC3XX_MAC_DRIVER)
59 cc3xx_mac_operation_t cc3xx_driver_ctx;
60#endif
61#if defined(PSA_NEED_OBERON_MAC_DRIVER)
62 oberon_mac_operation_t oberon_driver_ctx;
63#endif
64#if defined(PSA_CRYPTO_DRIVER_CRACEN)
65 cracen_mac_operation_t cracen_driver_ctx;
66#endif
68
69typedef union {
70 unsigned int dummy; /* Make sure this union is always non-empty */
71#if defined(PSA_NEED_CC3XX_AEAD_DRIVER)
72 struct {
73 cc3xx_aead_operation_t cc3xx_driver_ctx;
74 };
75#endif
76#if defined(PSA_NEED_OBERON_AEAD_DRIVER)
77 oberon_aead_operation_t oberon_driver_ctx;
78#endif
79#if defined(PSA_CRYPTO_DRIVER_CRACEN)
80 cracen_aead_operation_t cracen_driver_ctx;
81#endif /* PSA_CRYPTO_DRIVER_CRACEN */
82
84
85/* These contexts are used by psa_crypto.c and we need to define
86 * them in order to avoid building errors. We don't use these at all
87 * in the Oberon PSA core, the int type was chosen arbitrarily.
88 */
91
92#endif /* PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H */
93/* End of automatically generated file. */
Definition cracen_psa_primitives.h:344
Definition cracen_psa_primitives.h:387
int dummy
Definition crypto_driver_contexts_composites.h:89
Definition crypto_driver_contexts_composites.h:89
int dummy
Definition crypto_driver_contexts_composites.h:90
Definition crypto_driver_contexts_composites.h:90
unsigned int dummy
Definition crypto_driver_contexts_composites.h:70
Definition crypto_driver_contexts_composites.h:69
unsigned int dummy
Definition crypto_driver_contexts_composites.h:57
Definition crypto_driver_contexts_composites.h:56