1a8e1175bSopenharmony_ci/*
2a8e1175bSopenharmony_ci * Copyright The Mbed TLS Contributors
3a8e1175bSopenharmony_ci * SPDX-License-Identifier: Apache-2.0
4a8e1175bSopenharmony_ci *
5a8e1175bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); you may
6a8e1175bSopenharmony_ci * not use this file except in compliance with the License.
7a8e1175bSopenharmony_ci * You may obtain a copy of the License at
8a8e1175bSopenharmony_ci *
9a8e1175bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
10a8e1175bSopenharmony_ci *
11a8e1175bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
12a8e1175bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13a8e1175bSopenharmony_ci * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14a8e1175bSopenharmony_ci * See the License for the specific language governing permissions and
15a8e1175bSopenharmony_ci * limitations under the License.
16a8e1175bSopenharmony_ci *
17a8e1175bSopenharmony_ci */
18a8e1175bSopenharmony_ci
19a8e1175bSopenharmony_ci/**
20a8e1175bSopenharmony_ci * \file crypto_spe.h
21a8e1175bSopenharmony_ci *
22a8e1175bSopenharmony_ci * \brief When Mbed Crypto is built with the MBEDTLS_PSA_CRYPTO_SPM option
23a8e1175bSopenharmony_ci *        enabled, this header is included by all .c files in Mbed Crypto that
24a8e1175bSopenharmony_ci *        use PSA Crypto function names. This avoids duplication of symbols
25a8e1175bSopenharmony_ci *        between TF-M and Mbed Crypto.
26a8e1175bSopenharmony_ci *
27a8e1175bSopenharmony_ci * \note  This file should be included before including any PSA Crypto headers
28a8e1175bSopenharmony_ci *        from Mbed Crypto.
29a8e1175bSopenharmony_ci */
30a8e1175bSopenharmony_ci
31a8e1175bSopenharmony_ci#ifndef CRYPTO_SPE_H
32a8e1175bSopenharmony_ci#define CRYPTO_SPE_H
33a8e1175bSopenharmony_ci
34a8e1175bSopenharmony_ci#define PSA_FUNCTION_NAME(x) mbedcrypto__ ## x
35a8e1175bSopenharmony_ci
36a8e1175bSopenharmony_ci#define psa_crypto_init \
37a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_crypto_init)
38a8e1175bSopenharmony_ci#define psa_key_derivation_get_capacity \
39a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_key_derivation_get_capacity)
40a8e1175bSopenharmony_ci#define psa_key_derivation_set_capacity \
41a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_key_derivation_set_capacity)
42a8e1175bSopenharmony_ci#define psa_key_derivation_input_bytes \
43a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_key_derivation_input_bytes)
44a8e1175bSopenharmony_ci#define psa_key_derivation_output_bytes \
45a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_key_derivation_output_bytes)
46a8e1175bSopenharmony_ci#define psa_key_derivation_input_key \
47a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_key_derivation_input_key)
48a8e1175bSopenharmony_ci#define psa_key_derivation_output_key \
49a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_key_derivation_output_key)
50a8e1175bSopenharmony_ci#define psa_key_derivation_setup \
51a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_key_derivation_setup)
52a8e1175bSopenharmony_ci#define psa_key_derivation_abort \
53a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_key_derivation_abort)
54a8e1175bSopenharmony_ci#define psa_key_derivation_key_agreement \
55a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_key_derivation_key_agreement)
56a8e1175bSopenharmony_ci#define psa_raw_key_agreement \
57a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_raw_key_agreement)
58a8e1175bSopenharmony_ci#define psa_generate_random \
59a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_generate_random)
60a8e1175bSopenharmony_ci#define psa_aead_encrypt \
61a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_aead_encrypt)
62a8e1175bSopenharmony_ci#define psa_aead_decrypt \
63a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_aead_decrypt)
64a8e1175bSopenharmony_ci#define psa_open_key \
65a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_open_key)
66a8e1175bSopenharmony_ci#define psa_close_key \
67a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_close_key)
68a8e1175bSopenharmony_ci#define psa_import_key \
69a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_import_key)
70a8e1175bSopenharmony_ci#define psa_destroy_key \
71a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_destroy_key)
72a8e1175bSopenharmony_ci#define psa_get_key_attributes \
73a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_get_key_attributes)
74a8e1175bSopenharmony_ci#define psa_reset_key_attributes \
75a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_reset_key_attributes)
76a8e1175bSopenharmony_ci#define psa_export_key \
77a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_export_key)
78a8e1175bSopenharmony_ci#define psa_export_public_key \
79a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_export_public_key)
80a8e1175bSopenharmony_ci#define psa_purge_key \
81a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_purge_key)
82a8e1175bSopenharmony_ci#define psa_copy_key \
83a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_copy_key)
84a8e1175bSopenharmony_ci#define psa_cipher_operation_init \
85a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_cipher_operation_init)
86a8e1175bSopenharmony_ci#define psa_cipher_generate_iv \
87a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_cipher_generate_iv)
88a8e1175bSopenharmony_ci#define psa_cipher_set_iv \
89a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_cipher_set_iv)
90a8e1175bSopenharmony_ci#define psa_cipher_encrypt_setup \
91a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_cipher_encrypt_setup)
92a8e1175bSopenharmony_ci#define psa_cipher_decrypt_setup \
93a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_cipher_decrypt_setup)
94a8e1175bSopenharmony_ci#define psa_cipher_update \
95a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_cipher_update)
96a8e1175bSopenharmony_ci#define psa_cipher_finish \
97a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_cipher_finish)
98a8e1175bSopenharmony_ci#define psa_cipher_abort \
99a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_cipher_abort)
100a8e1175bSopenharmony_ci#define psa_hash_operation_init \
101a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_hash_operation_init)
102a8e1175bSopenharmony_ci#define psa_hash_setup \
103a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_hash_setup)
104a8e1175bSopenharmony_ci#define psa_hash_update \
105a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_hash_update)
106a8e1175bSopenharmony_ci#define psa_hash_finish \
107a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_hash_finish)
108a8e1175bSopenharmony_ci#define psa_hash_verify \
109a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_hash_verify)
110a8e1175bSopenharmony_ci#define psa_hash_abort \
111a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_hash_abort)
112a8e1175bSopenharmony_ci#define psa_hash_clone \
113a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_hash_clone)
114a8e1175bSopenharmony_ci#define psa_hash_compute \
115a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_hash_compute)
116a8e1175bSopenharmony_ci#define psa_hash_compare \
117a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_hash_compare)
118a8e1175bSopenharmony_ci#define psa_mac_operation_init \
119a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_mac_operation_init)
120a8e1175bSopenharmony_ci#define psa_mac_sign_setup \
121a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_mac_sign_setup)
122a8e1175bSopenharmony_ci#define psa_mac_verify_setup \
123a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_mac_verify_setup)
124a8e1175bSopenharmony_ci#define psa_mac_update \
125a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_mac_update)
126a8e1175bSopenharmony_ci#define psa_mac_sign_finish \
127a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_mac_sign_finish)
128a8e1175bSopenharmony_ci#define psa_mac_verify_finish \
129a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_mac_verify_finish)
130a8e1175bSopenharmony_ci#define psa_mac_abort \
131a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_mac_abort)
132a8e1175bSopenharmony_ci#define psa_sign_hash \
133a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_sign_hash)
134a8e1175bSopenharmony_ci#define psa_verify_hash \
135a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_verify_hash)
136a8e1175bSopenharmony_ci#define psa_asymmetric_encrypt \
137a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_asymmetric_encrypt)
138a8e1175bSopenharmony_ci#define psa_asymmetric_decrypt \
139a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_asymmetric_decrypt)
140a8e1175bSopenharmony_ci#define psa_generate_key \
141a8e1175bSopenharmony_ci    PSA_FUNCTION_NAME(psa_generate_key)
142a8e1175bSopenharmony_ci
143a8e1175bSopenharmony_ci#endif /* CRYPTO_SPE_H */
144