File: crypto_spe.h

package info (click to toggle)
edk2 2025.02-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 271,704 kB
  • sloc: ansic: 2,109,987; asm: 263,832; perl: 227,730; python: 149,919; sh: 34,967; cpp: 21,813; makefile: 3,282; xml: 806; pascal: 721; lisp: 35; ruby: 16; sed: 6; tcl: 4
file content (143 lines) | stat: -rw-r--r-- 5,294 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
 * Copyright The Mbed TLS Contributors
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

/**
 * \file crypto_spe.h
 *
 * \brief When Mbed Crypto is built with the MBEDTLS_PSA_CRYPTO_SPM option
 *        enabled, this header is included by all .c files in Mbed Crypto that
 *        use PSA Crypto function names. This avoids duplication of symbols
 *        between TF-M and Mbed Crypto.
 *
 * \note  This file should be included before including any PSA Crypto headers
 *        from Mbed Crypto.
 */

#ifndef CRYPTO_SPE_H
#define CRYPTO_SPE_H

#define PSA_FUNCTION_NAME(x) mbedcrypto__ ## x

#define psa_crypto_init \
        PSA_FUNCTION_NAME(psa_crypto_init)
#define psa_key_derivation_get_capacity \
        PSA_FUNCTION_NAME(psa_key_derivation_get_capacity)
#define psa_key_derivation_set_capacity \
        PSA_FUNCTION_NAME(psa_key_derivation_set_capacity)
#define psa_key_derivation_input_bytes \
        PSA_FUNCTION_NAME(psa_key_derivation_input_bytes)
#define psa_key_derivation_output_bytes \
        PSA_FUNCTION_NAME(psa_key_derivation_output_bytes)
#define psa_key_derivation_input_key \
        PSA_FUNCTION_NAME(psa_key_derivation_input_key)
#define psa_key_derivation_output_key \
        PSA_FUNCTION_NAME(psa_key_derivation_output_key)
#define psa_key_derivation_setup \
        PSA_FUNCTION_NAME(psa_key_derivation_setup)
#define psa_key_derivation_abort \
        PSA_FUNCTION_NAME(psa_key_derivation_abort)
#define psa_key_derivation_key_agreement \
        PSA_FUNCTION_NAME(psa_key_derivation_key_agreement)
#define psa_raw_key_agreement \
        PSA_FUNCTION_NAME(psa_raw_key_agreement)
#define psa_generate_random \
        PSA_FUNCTION_NAME(psa_generate_random)
#define psa_aead_encrypt \
        PSA_FUNCTION_NAME(psa_aead_encrypt)
#define psa_aead_decrypt \
        PSA_FUNCTION_NAME(psa_aead_decrypt)
#define psa_open_key \
        PSA_FUNCTION_NAME(psa_open_key)
#define psa_close_key \
        PSA_FUNCTION_NAME(psa_close_key)
#define psa_import_key \
        PSA_FUNCTION_NAME(psa_import_key)
#define psa_destroy_key \
        PSA_FUNCTION_NAME(psa_destroy_key)
#define psa_get_key_attributes \
        PSA_FUNCTION_NAME(psa_get_key_attributes)
#define psa_reset_key_attributes \
        PSA_FUNCTION_NAME(psa_reset_key_attributes)
#define psa_export_key \
        PSA_FUNCTION_NAME(psa_export_key)
#define psa_export_public_key \
        PSA_FUNCTION_NAME(psa_export_public_key)
#define psa_purge_key \
        PSA_FUNCTION_NAME(psa_purge_key)
#define psa_copy_key \
        PSA_FUNCTION_NAME(psa_copy_key)
#define psa_cipher_operation_init \
        PSA_FUNCTION_NAME(psa_cipher_operation_init)
#define psa_cipher_generate_iv \
        PSA_FUNCTION_NAME(psa_cipher_generate_iv)
#define psa_cipher_set_iv \
        PSA_FUNCTION_NAME(psa_cipher_set_iv)
#define psa_cipher_encrypt_setup \
        PSA_FUNCTION_NAME(psa_cipher_encrypt_setup)
#define psa_cipher_decrypt_setup \
        PSA_FUNCTION_NAME(psa_cipher_decrypt_setup)
#define psa_cipher_update \
        PSA_FUNCTION_NAME(psa_cipher_update)
#define psa_cipher_finish \
        PSA_FUNCTION_NAME(psa_cipher_finish)
#define psa_cipher_abort \
        PSA_FUNCTION_NAME(psa_cipher_abort)
#define psa_hash_operation_init \
        PSA_FUNCTION_NAME(psa_hash_operation_init)
#define psa_hash_setup \
        PSA_FUNCTION_NAME(psa_hash_setup)
#define psa_hash_update \
        PSA_FUNCTION_NAME(psa_hash_update)
#define psa_hash_finish \
        PSA_FUNCTION_NAME(psa_hash_finish)
#define psa_hash_verify \
        PSA_FUNCTION_NAME(psa_hash_verify)
#define psa_hash_abort \
        PSA_FUNCTION_NAME(psa_hash_abort)
#define psa_hash_clone \
        PSA_FUNCTION_NAME(psa_hash_clone)
#define psa_hash_compute \
        PSA_FUNCTION_NAME(psa_hash_compute)
#define psa_hash_compare \
        PSA_FUNCTION_NAME(psa_hash_compare)
#define psa_mac_operation_init \
        PSA_FUNCTION_NAME(psa_mac_operation_init)
#define psa_mac_sign_setup \
        PSA_FUNCTION_NAME(psa_mac_sign_setup)
#define psa_mac_verify_setup \
        PSA_FUNCTION_NAME(psa_mac_verify_setup)
#define psa_mac_update \
        PSA_FUNCTION_NAME(psa_mac_update)
#define psa_mac_sign_finish \
        PSA_FUNCTION_NAME(psa_mac_sign_finish)
#define psa_mac_verify_finish \
        PSA_FUNCTION_NAME(psa_mac_verify_finish)
#define psa_mac_abort \
        PSA_FUNCTION_NAME(psa_mac_abort)
#define psa_sign_hash \
        PSA_FUNCTION_NAME(psa_sign_hash)
#define psa_verify_hash \
        PSA_FUNCTION_NAME(psa_verify_hash)
#define psa_asymmetric_encrypt \
        PSA_FUNCTION_NAME(psa_asymmetric_encrypt)
#define psa_asymmetric_decrypt \
        PSA_FUNCTION_NAME(psa_asymmetric_decrypt)
#define psa_generate_key \
        PSA_FUNCTION_NAME(psa_generate_key)

#endif /* CRYPTO_SPE_H */