Gilles Peskine | 7597689 | 2018-12-12 15:55:09 +0100 | [diff] [blame] | 1 | /** |
| 2 | * \file psa/crypto_driver_common.h |
| 3 | * \brief Definitions for all PSA crypto drivers |
| 4 | * |
| 5 | * This file contains common definitions shared by all PSA crypto drivers. |
| 6 | * Do not include it directly: instead, include the header file(s) for |
| 7 | * the type(s) of driver that you are implementing. For example, if |
Gilles Peskine | db6b03b | 2020-11-30 17:37:14 +0100 | [diff] [blame] | 8 | * you are writing a dynamically registered driver for a secure element, |
| 9 | * include `psa/crypto_se_driver.h`. |
Gilles Peskine | 7597689 | 2018-12-12 15:55:09 +0100 | [diff] [blame] | 10 | * |
| 11 | * This file is part of the PSA Crypto Driver Model, containing functions for |
| 12 | * driver developers to implement to enable hardware to be called in a |
| 13 | * standardized way by a PSA Cryptographic API implementation. The functions |
| 14 | * comprising the driver model, which driver authors implement, are not |
| 15 | * intended to be called by application developers. |
| 16 | */ |
| 17 | |
| 18 | /* |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 19 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 20 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Gilles Peskine | 7597689 | 2018-12-12 15:55:09 +0100 | [diff] [blame] | 21 | */ |
| 22 | #ifndef PSA_CRYPTO_DRIVER_COMMON_H |
| 23 | #define PSA_CRYPTO_DRIVER_COMMON_H |
| 24 | |
| 25 | #include <stddef.h> |
| 26 | #include <stdint.h> |
| 27 | |
| 28 | /* Include type definitions (psa_status_t, psa_algorithm_t, |
| 29 | * psa_key_type_t, etc.) and macros to build and analyze values |
| 30 | * of these types. */ |
| 31 | #include "crypto_types.h" |
| 32 | #include "crypto_values.h" |
Gilles Peskine | 09c02ee | 2021-11-25 20:30:47 +0100 | [diff] [blame] | 33 | /* Include size definitions which are used to size some arrays in operation |
| 34 | * structures. */ |
| 35 | #include <psa/crypto_sizes.h> |
Gilles Peskine | 7597689 | 2018-12-12 15:55:09 +0100 | [diff] [blame] | 36 | |
| 37 | /** For encrypt-decrypt functions, whether the operation is an encryption |
| 38 | * or a decryption. */ |
| 39 | typedef enum { |
| 40 | PSA_CRYPTO_DRIVER_DECRYPT, |
| 41 | PSA_CRYPTO_DRIVER_ENCRYPT |
| 42 | } psa_encrypt_or_decrypt_t; |
| 43 | |
| 44 | #endif /* PSA_CRYPTO_DRIVER_COMMON_H */ |