1a8e1175bSopenharmony_ci/** 2a8e1175bSopenharmony_ci * \file psa/crypto_legacy.h 3a8e1175bSopenharmony_ci * 4a8e1175bSopenharmony_ci * \brief Add temporary suppport for deprecated symbols before they are 5a8e1175bSopenharmony_ci * removed from the library. 6a8e1175bSopenharmony_ci * 7a8e1175bSopenharmony_ci * PSA_WANT_KEY_TYPE_xxx_KEY_PAIR and MBEDTLS_PSA_ACCEL_KEY_TYPE_xxx_KEY_PAIR 8a8e1175bSopenharmony_ci * symbols are deprecated. 9a8e1175bSopenharmony_ci * New symols add a suffix to that base name in order to clearly state what is 10a8e1175bSopenharmony_ci * the expected use for the key (use, import, export, generate, derive). 11a8e1175bSopenharmony_ci * Here we define some backward compatibility support for uses stil using 12a8e1175bSopenharmony_ci * the legacy symbols. 13a8e1175bSopenharmony_ci */ 14a8e1175bSopenharmony_ci/* 15a8e1175bSopenharmony_ci * Copyright The Mbed TLS Contributors 16a8e1175bSopenharmony_ci * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 17a8e1175bSopenharmony_ci */ 18a8e1175bSopenharmony_ci 19a8e1175bSopenharmony_ci#ifndef MBEDTLS_PSA_CRYPTO_LEGACY_H 20a8e1175bSopenharmony_ci#define MBEDTLS_PSA_CRYPTO_LEGACY_H 21a8e1175bSopenharmony_ci 22a8e1175bSopenharmony_ci#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR) //no-check-names 23a8e1175bSopenharmony_ci#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC) 24a8e1175bSopenharmony_ci#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC 1 25a8e1175bSopenharmony_ci#endif 26a8e1175bSopenharmony_ci#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT) 27a8e1175bSopenharmony_ci#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT 1 28a8e1175bSopenharmony_ci#endif 29a8e1175bSopenharmony_ci#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT) 30a8e1175bSopenharmony_ci#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT 1 31a8e1175bSopenharmony_ci#endif 32a8e1175bSopenharmony_ci#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE) 33a8e1175bSopenharmony_ci#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE 1 34a8e1175bSopenharmony_ci#endif 35a8e1175bSopenharmony_ci#if !defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE) 36a8e1175bSopenharmony_ci#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE 1 37a8e1175bSopenharmony_ci#endif 38a8e1175bSopenharmony_ci#endif 39a8e1175bSopenharmony_ci 40a8e1175bSopenharmony_ci#if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR) //no-check-names 41a8e1175bSopenharmony_ci#if !defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) 42a8e1175bSopenharmony_ci#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC 1 43a8e1175bSopenharmony_ci#endif 44a8e1175bSopenharmony_ci#if !defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT) 45a8e1175bSopenharmony_ci#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT 1 46a8e1175bSopenharmony_ci#endif 47a8e1175bSopenharmony_ci#if !defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT) 48a8e1175bSopenharmony_ci#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT 1 49a8e1175bSopenharmony_ci#endif 50a8e1175bSopenharmony_ci#if !defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE) 51a8e1175bSopenharmony_ci#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE 1 52a8e1175bSopenharmony_ci#endif 53a8e1175bSopenharmony_ci#endif 54a8e1175bSopenharmony_ci 55a8e1175bSopenharmony_ci#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) //no-check-names 56a8e1175bSopenharmony_ci#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_BASIC) 57a8e1175bSopenharmony_ci#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_BASIC 58a8e1175bSopenharmony_ci#endif 59a8e1175bSopenharmony_ci#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT) 60a8e1175bSopenharmony_ci#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT 61a8e1175bSopenharmony_ci#endif 62a8e1175bSopenharmony_ci#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT) 63a8e1175bSopenharmony_ci#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT 64a8e1175bSopenharmony_ci#endif 65a8e1175bSopenharmony_ci#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE) 66a8e1175bSopenharmony_ci#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE 67a8e1175bSopenharmony_ci#endif 68a8e1175bSopenharmony_ci#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE) 69a8e1175bSopenharmony_ci#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE 70a8e1175bSopenharmony_ci#endif 71a8e1175bSopenharmony_ci#endif 72a8e1175bSopenharmony_ci 73a8e1175bSopenharmony_ci#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) //no-check-names 74a8e1175bSopenharmony_ci#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_BASIC) 75a8e1175bSopenharmony_ci#define MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_BASIC 76a8e1175bSopenharmony_ci#endif 77a8e1175bSopenharmony_ci#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_IMPORT) 78a8e1175bSopenharmony_ci#define MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_IMPORT 79a8e1175bSopenharmony_ci#endif 80a8e1175bSopenharmony_ci#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_EXPORT) 81a8e1175bSopenharmony_ci#define MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_EXPORT 82a8e1175bSopenharmony_ci#endif 83a8e1175bSopenharmony_ci#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_GENERATE) 84a8e1175bSopenharmony_ci#define MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_GENERATE 85a8e1175bSopenharmony_ci#endif 86a8e1175bSopenharmony_ci#endif 87a8e1175bSopenharmony_ci 88a8e1175bSopenharmony_ci#endif /* MBEDTLS_PSA_CRYPTO_LEGACY_H */ 89