blob: f80fd86bdc2780a34b93ec8b04a782069d2a3238 [file] [log] [blame]
Gilles Peskinedb9c18d2021-06-15 18:18:07 +02001/*
2 * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8/**
9 * \file crypto_spe.h
10 *
11 * \brief When Mbed Crypto is built with the MBEDTLS_PSA_CRYPTO_SPM option
12 * enabled, this header is included by all .c files in Mbed Crypto that
13 * use PSA Crypto function names. This avoids duplication of symbols
14 * between TF-M and Mbed Crypto.
15 *
16 * \note This file should be included before including any PSA Crypto headers
17 * from Mbed Crypto.
18 */
19
20#ifndef CRYPTO_SPE_H
21#define CRYPTO_SPE_H
22
23#define PSA_FUNCTION_NAME(x) mbedcrypto__ ## x
24
25#define psa_crypto_init \
26 PSA_FUNCTION_NAME(psa_crypto_init)
27#define psa_key_derivation_get_capacity \
28 PSA_FUNCTION_NAME(psa_key_derivation_get_capacity)
29#define psa_key_derivation_set_capacity \
30 PSA_FUNCTION_NAME(psa_key_derivation_set_capacity)
31#define psa_key_derivation_input_bytes \
32 PSA_FUNCTION_NAME(psa_key_derivation_input_bytes)
33#define psa_key_derivation_output_bytes \
34 PSA_FUNCTION_NAME(psa_key_derivation_output_bytes)
35#define psa_key_derivation_input_key \
36 PSA_FUNCTION_NAME(psa_key_derivation_input_key)
37#define psa_key_derivation_output_key \
38 PSA_FUNCTION_NAME(psa_key_derivation_output_key)
39#define psa_key_derivation_setup \
40 PSA_FUNCTION_NAME(psa_key_derivation_setup)
41#define psa_key_derivation_abort \
42 PSA_FUNCTION_NAME(psa_key_derivation_abort)
43#define psa_key_derivation_key_agreement \
44 PSA_FUNCTION_NAME(psa_key_derivation_key_agreement)
45#define psa_raw_key_agreement \
46 PSA_FUNCTION_NAME(psa_raw_key_agreement)
47#define psa_generate_random \
48 PSA_FUNCTION_NAME(psa_generate_random)
49#define psa_aead_encrypt \
50 PSA_FUNCTION_NAME(psa_aead_encrypt)
51#define psa_aead_decrypt \
52 PSA_FUNCTION_NAME(psa_aead_decrypt)
53#define psa_open_key \
54 PSA_FUNCTION_NAME(psa_open_key)
55#define psa_close_key \
56 PSA_FUNCTION_NAME(psa_close_key)
57#define psa_import_key \
58 PSA_FUNCTION_NAME(psa_import_key)
59#define psa_destroy_key \
60 PSA_FUNCTION_NAME(psa_destroy_key)
61#define psa_get_key_attributes \
62 PSA_FUNCTION_NAME(psa_get_key_attributes)
63#define psa_reset_key_attributes \
64 PSA_FUNCTION_NAME(psa_reset_key_attributes)
65#define psa_export_key \
66 PSA_FUNCTION_NAME(psa_export_key)
67#define psa_export_public_key \
68 PSA_FUNCTION_NAME(psa_export_public_key)
69#define psa_purge_key \
70 PSA_FUNCTION_NAME(psa_purge_key)
71#define psa_copy_key \
72 PSA_FUNCTION_NAME(psa_copy_key)
73#define psa_cipher_operation_init \
74 PSA_FUNCTION_NAME(psa_cipher_operation_init)
75#define psa_cipher_generate_iv \
76 PSA_FUNCTION_NAME(psa_cipher_generate_iv)
77#define psa_cipher_set_iv \
78 PSA_FUNCTION_NAME(psa_cipher_set_iv)
79#define psa_cipher_encrypt_setup \
80 PSA_FUNCTION_NAME(psa_cipher_encrypt_setup)
81#define psa_cipher_decrypt_setup \
82 PSA_FUNCTION_NAME(psa_cipher_decrypt_setup)
83#define psa_cipher_update \
84 PSA_FUNCTION_NAME(psa_cipher_update)
85#define psa_cipher_finish \
86 PSA_FUNCTION_NAME(psa_cipher_finish)
87#define psa_cipher_abort \
88 PSA_FUNCTION_NAME(psa_cipher_abort)
89#define psa_hash_operation_init \
90 PSA_FUNCTION_NAME(psa_hash_operation_init)
91#define psa_hash_setup \
92 PSA_FUNCTION_NAME(psa_hash_setup)
93#define psa_hash_update \
94 PSA_FUNCTION_NAME(psa_hash_update)
95#define psa_hash_finish \
96 PSA_FUNCTION_NAME(psa_hash_finish)
97#define psa_hash_verify \
98 PSA_FUNCTION_NAME(psa_hash_verify)
99#define psa_hash_abort \
100 PSA_FUNCTION_NAME(psa_hash_abort)
101#define psa_hash_clone \
102 PSA_FUNCTION_NAME(psa_hash_clone)
103#define psa_hash_compute \
104 PSA_FUNCTION_NAME(psa_hash_compute)
105#define psa_hash_compare \
106 PSA_FUNCTION_NAME(psa_hash_compare)
107#define psa_mac_operation_init \
108 PSA_FUNCTION_NAME(psa_mac_operation_init)
109#define psa_mac_sign_setup \
110 PSA_FUNCTION_NAME(psa_mac_sign_setup)
111#define psa_mac_verify_setup \
112 PSA_FUNCTION_NAME(psa_mac_verify_setup)
113#define psa_mac_update \
114 PSA_FUNCTION_NAME(psa_mac_update)
115#define psa_mac_sign_finish \
116 PSA_FUNCTION_NAME(psa_mac_sign_finish)
117#define psa_mac_verify_finish \
118 PSA_FUNCTION_NAME(psa_mac_verify_finish)
119#define psa_mac_abort \
120 PSA_FUNCTION_NAME(psa_mac_abort)
121#define psa_sign_hash \
122 PSA_FUNCTION_NAME(psa_sign_hash)
123#define psa_verify_hash \
124 PSA_FUNCTION_NAME(psa_verify_hash)
125#define psa_asymmetric_encrypt \
126 PSA_FUNCTION_NAME(psa_asymmetric_encrypt)
127#define psa_asymmetric_decrypt \
128 PSA_FUNCTION_NAME(psa_asymmetric_decrypt)
129#define psa_generate_key \
130 PSA_FUNCTION_NAME(psa_generate_key)
131
132#endif /* CRYPTO_SPE_H */