1a8e1175bSopenharmony_ci/** 2a8e1175bSopenharmony_ci * \file psa/crypto_driver_common.h 3a8e1175bSopenharmony_ci * \brief Definitions for all PSA crypto drivers 4a8e1175bSopenharmony_ci * 5a8e1175bSopenharmony_ci * This file contains common definitions shared by all PSA crypto drivers. 6a8e1175bSopenharmony_ci * Do not include it directly: instead, include the header file(s) for 7a8e1175bSopenharmony_ci * the type(s) of driver that you are implementing. For example, if 8a8e1175bSopenharmony_ci * you are writing a dynamically registered driver for a secure element, 9a8e1175bSopenharmony_ci * include `psa/crypto_se_driver.h`. 10a8e1175bSopenharmony_ci * 11a8e1175bSopenharmony_ci * This file is part of the PSA Crypto Driver Model, containing functions for 12a8e1175bSopenharmony_ci * driver developers to implement to enable hardware to be called in a 13a8e1175bSopenharmony_ci * standardized way by a PSA Cryptographic API implementation. The functions 14a8e1175bSopenharmony_ci * comprising the driver model, which driver authors implement, are not 15a8e1175bSopenharmony_ci * intended to be called by application developers. 16a8e1175bSopenharmony_ci */ 17a8e1175bSopenharmony_ci 18a8e1175bSopenharmony_ci/* 19a8e1175bSopenharmony_ci * Copyright The Mbed TLS Contributors 20a8e1175bSopenharmony_ci * SPDX-License-Identifier: Apache-2.0 21a8e1175bSopenharmony_ci * 22a8e1175bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); you may 23a8e1175bSopenharmony_ci * not use this file except in compliance with the License. 24a8e1175bSopenharmony_ci * You may obtain a copy of the License at 25a8e1175bSopenharmony_ci * 26a8e1175bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 27a8e1175bSopenharmony_ci * 28a8e1175bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 29a8e1175bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 30a8e1175bSopenharmony_ci * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 31a8e1175bSopenharmony_ci * See the License for the specific language governing permissions and 32a8e1175bSopenharmony_ci * limitations under the License. 33a8e1175bSopenharmony_ci */ 34a8e1175bSopenharmony_ci#ifndef PSA_CRYPTO_DRIVER_COMMON_H 35a8e1175bSopenharmony_ci#define PSA_CRYPTO_DRIVER_COMMON_H 36a8e1175bSopenharmony_ci 37a8e1175bSopenharmony_ci#include <stddef.h> 38a8e1175bSopenharmony_ci#include <stdint.h> 39a8e1175bSopenharmony_ci 40a8e1175bSopenharmony_ci/* Include type definitions (psa_status_t, psa_algorithm_t, 41a8e1175bSopenharmony_ci * psa_key_type_t, etc.) and macros to build and analyze values 42a8e1175bSopenharmony_ci * of these types. */ 43a8e1175bSopenharmony_ci#include "crypto_types.h" 44a8e1175bSopenharmony_ci#include "crypto_values.h" 45a8e1175bSopenharmony_ci/* Include size definitions which are used to size some arrays in operation 46a8e1175bSopenharmony_ci * structures. */ 47a8e1175bSopenharmony_ci#include <psa/crypto_sizes.h> 48a8e1175bSopenharmony_ci 49a8e1175bSopenharmony_ci/** For encrypt-decrypt functions, whether the operation is an encryption 50a8e1175bSopenharmony_ci * or a decryption. */ 51a8e1175bSopenharmony_citypedef enum { 52a8e1175bSopenharmony_ci PSA_CRYPTO_DRIVER_DECRYPT, 53a8e1175bSopenharmony_ci PSA_CRYPTO_DRIVER_ENCRYPT 54a8e1175bSopenharmony_ci} psa_encrypt_or_decrypt_t; 55a8e1175bSopenharmony_ci 56a8e1175bSopenharmony_ci#endif /* PSA_CRYPTO_DRIVER_COMMON_H */ 57