mbed TLS v2.24.0
crypto_types.h
Go to the documentation of this file.
1 
16 /*
17  * Copyright The Mbed TLS Contributors
18  * SPDX-License-Identifier: Apache-2.0
19  *
20  * Licensed under the Apache License, Version 2.0 (the "License"); you may
21  * not use this file except in compliance with the License.
22  * You may obtain a copy of the License at
23  *
24  * http://www.apache.org/licenses/LICENSE-2.0
25  *
26  * Unless required by applicable law or agreed to in writing, software
27  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
28  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29  * See the License for the specific language governing permissions and
30  * limitations under the License.
31  */
32 
33 #ifndef PSA_CRYPTO_TYPES_H
34 #define PSA_CRYPTO_TYPES_H
35 
36 #include <stdint.h>
37 
48 /* If #PSA_SUCCESS is already defined, it means that #psa_status_t
49  * is also defined in an external header, so prevent its multiple
50  * definition.
51  */
52 #ifndef PSA_SUCCESS
53 typedef int32_t psa_status_t;
54 #endif
55 
64 typedef uint16_t psa_key_type_t;
65 
75 typedef uint8_t psa_ecc_family_t;
76 
86 typedef uint8_t psa_dh_family_t;
87 
96 typedef uint32_t psa_algorithm_t;
97 
139 typedef uint32_t psa_key_lifetime_t;
140 
184 typedef uint8_t psa_key_persistence_t;
185 
218 typedef uint32_t psa_key_location_t;
219 
229 /* Implementation-specific quirk: The Mbed Crypto library can be built as
230  * part of a multi-client service that exposes the PSA Crypto API in each
231  * client and encodes the client identity in the key id argument of functions
232  * such as psa_open_key(). In this build configuration, we define
233  * psa_key_id_t in crypto_platform.h instead of here. */
234 #if !defined(MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER)
235 typedef uint32_t psa_key_id_t;
236 #define PSA_KEY_ID_INIT 0
237 #endif
238 
246 typedef uint32_t psa_key_usage_t;
247 
361 
362 
363 #ifndef __DOXYGEN_ONLY__
364 #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
365 /* Mbed Crypto defines this type in crypto_types.h because it is also
366  * visible to applications through an implementation-specific extension.
367  * For the PSA Cryptography specification, this type is only visible
368  * via crypto_se_driver.h. */
369 typedef uint64_t psa_key_slot_number_t;
370 #endif /* MBEDTLS_PSA_CRYPTO_SE_C */
371 #endif /* !__DOXYGEN_ONLY__ */
372 
380 typedef uint16_t psa_key_derivation_step_t;
381 
384 #endif /* PSA_CRYPTO_TYPES_H */
uint8_t psa_key_persistence_t
Definition: crypto_types.h:184
uint16_t psa_key_derivation_step_t
Encoding of the step of a key derivation.
Definition: crypto_types.h:380
uint32_t psa_key_id_t
Definition: crypto_types.h:235
uint8_t psa_dh_family_t
Definition: crypto_types.h:86
uint32_t psa_key_location_t
Definition: crypto_types.h:218
uint64_t psa_key_slot_number_t
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition: crypto_types.h:96
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
Definition: crypto_types.h:246
uint16_t psa_key_type_t
Encoding of a key type.
Definition: crypto_types.h:64
uint32_t psa_key_lifetime_t
Definition: crypto_types.h:139
uint8_t psa_ecc_family_t
Definition: crypto_types.h:75
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:53