0.2.0-dev Download ZIP
42 lines ·1.4 KB Raw
| 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. |
| 8 | * |
| 9 | * This file is part of the PSA Crypto Driver Model, containing functions for |
| 10 | * driver developers to implement to enable hardware to be called in a |
| 11 | * standardized way by a PSA Cryptographic API implementation. The functions |
| 12 | * comprising the driver model, which driver authors implement, are not |
| 13 | * intended to be called by application developers. |
| 14 | */ |
| 15 | |
| 16 | /* |
| 17 | * Copyright The Mbed TLS Contributors |
| 18 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
| 19 | */ |
| 20 | #ifndef PSA_CRYPTO_DRIVER_COMMON_H |
| 21 | #define PSA_CRYPTO_DRIVER_COMMON_H |
| 22 | |
| 23 | #include <stddef.h> |
| 24 | #include <stdint.h> |
| 25 | |
| 26 | /* Include type definitions (psa_status_t, psa_algorithm_t, |
| 27 | * psa_key_type_t, etc.) and macros to build and analyze values |
| 28 | * of these types. */ |
| 29 | #include "crypto_types.h" |
| 30 | #include "crypto_values.h" |
| 31 | /* Include size definitions which are used to size some arrays in operation |
| 32 | * structures. */ |
| 33 | #include <psa/crypto_sizes.h> |
| 34 | |
| 35 | /** For encrypt-decrypt functions, whether the operation is an encryption |
| 36 | * or a decryption. */ |
| 37 | typedef enum { |
| 38 | PSA_CRYPTO_DRIVER_DECRYPT, |
| 39 | PSA_CRYPTO_DRIVER_ENCRYPT |
| 40 | } psa_encrypt_or_decrypt_t; |
| 41 | |
| 42 | #endif /* PSA_CRYPTO_DRIVER_COMMON_H */ |