mbed TLS v2.23.0: crypto_types.h Source File

mbed TLS v2.23.0

crypto_types.h
Go to the documentation of this file.
1
16 /*
17 * Copyright (C) 2018, ARM Limited, All Rights Reserved
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 * This file is part of mbed TLS (https://tls.mbed.org)
33 */
34
35 #ifndef PSA_CRYPTO_TYPES_H
36 #define PSA_CRYPTO_TYPES_H
37
38 #include <stdint.h>
39
50 /* If #PSA_SUCCESS is already defined, it means that #psa_status_t
51 * is also defined in an external header, so prevent its multiple
52 * definition.
53 */
54 #ifndef PSA_SUCCESS
55 typedef int32_t psa_status_t;
56 #endif
57
66 typedef uint16_t psa_key_type_t;
67
77 typedef uint8_t psa_ecc_curve_t;
78
88 typedef uint8_t psa_dh_group_t;
89
98 typedef uint32_t psa_algorithm_t;
99
141 typedef uint32_t psa_key_lifetime_t;
142
186 typedef uint8_t psa_key_persistence_t;
187
220 typedef uint32_t psa_key_location_t;
221
231 /* Implementation-specific quirk: The Mbed Crypto library can be built as
232 * part of a multi-client service that exposes the PSA Crypto API in each
233 * client and encodes the client identity in the key id argument of functions
234 * such as psa_open_key(). In this build configuration, we define
235 * psa_key_id_t in crypto_platform.h instead of here. */
236 #if !defined(MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER)
237 typedef uint32_t psa_key_id_t;
238 #define PSA_KEY_ID_INIT 0
239 #endif
240
248 typedef uint32_t psa_key_usage_t;
249
362 typedef struct psa_key_attributes_s psa_key_attributes_t;
363
364
365 #ifndef __DOXYGEN_ONLY__
366 #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
367 /* Mbed Crypto defines this type in crypto_types.h because it is also
368 * visible to applications through an implementation-specific extension.
369 * For the PSA Cryptography specification, this type is only visible
370 * via crypto_se_driver.h. */
371 typedef uint64_t psa_key_slot_number_t;
372 #endif /* MBEDTLS_PSA_CRYPTO_SE_C */
373 #endif /* !__DOXYGEN_ONLY__ */
374
382 typedef uint16_t psa_key_derivation_step_t;
383
386 #endif /* PSA_CRYPTO_TYPES_H */
psa_status_t
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:55
psa_key_attributes_s
Definition: crypto_struct.h:343
psa_key_persistence_t
uint8_t psa_key_persistence_t
Definition: crypto_types.h:186
psa_ecc_curve_t
uint8_t psa_ecc_curve_t
Definition: crypto_types.h:77
psa_key_id_t
uint32_t psa_key_id_t
Definition: crypto_types.h:237
psa_key_location_t
uint32_t psa_key_location_t
Definition: crypto_types.h:220
psa_key_slot_number_t
uint64_t psa_key_slot_number_t
Definition: crypto_se_driver.h:148
psa_key_usage_t
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
Definition: crypto_types.h:248
psa_algorithm_t
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition: crypto_types.h:98
psa_key_derivation_step_t
uint16_t psa_key_derivation_step_t
Encoding of the step of a key derivation.
Definition: crypto_types.h:382
psa_key_type_t
uint16_t psa_key_type_t
Encoding of a key type.
Definition: crypto_types.h:66
psa_key_lifetime_t
uint32_t psa_key_lifetime_t
Definition: crypto_types.h:141
psa_dh_group_t
uint8_t psa_dh_group_t
Definition: crypto_types.h:88