mbed TLS v2.28.4
Loading...
Searching...
No Matches
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 "crypto_platform.h"
37
38/* If MBEDTLS_PSA_CRYPTO_C is defined, make sure MBEDTLS_PSA_CRYPTO_CLIENT
39 * is defined as well to include all PSA code.
40 */
41#if defined(MBEDTLS_PSA_CRYPTO_C)
42#define MBEDTLS_PSA_CRYPTO_CLIENT
43#endif /* MBEDTLS_PSA_CRYPTO_C */
44
45#include <stdint.h>
46
57/* If #PSA_SUCCESS is already defined, it means that #psa_status_t
58 * is also defined in an external header, so prevent its multiple
59 * definition.
60 */
61#ifndef PSA_SUCCESS
62typedef int32_t psa_status_t;
63#endif
64
81typedef uint16_t psa_key_type_t;
82
100typedef uint8_t psa_ecc_family_t;
101
119typedef uint8_t psa_dh_family_t;
120
137typedef uint32_t psa_algorithm_t;
138
186typedef uint32_t psa_key_lifetime_t;
187
222typedef uint8_t psa_key_persistence_t;
223
263typedef uint32_t psa_key_location_t;
264
278typedef uint32_t psa_key_id_t;
279
294#if !defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER)
296
297#else /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
298/* Implementation-specific: The Mbed TLS library can be built as
299 * part of a multi-client service that exposes the PSA Cryptography API in each
300 * client and encodes the client identity in the key identifier argument of
301 * functions such as psa_open_key().
302 */
303typedef struct {
304 psa_key_id_t key_id;
305 mbedtls_key_owner_id_t owner;
307
308#endif /* !MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
309
326typedef uint32_t psa_key_usage_t;
327
436
437
438#ifndef __DOXYGEN_ONLY__
439#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
440/* Mbed TLS defines this type in crypto_types.h because it is also
441 * visible to applications through an implementation-specific extension.
442 * For the PSA Cryptography specification, this type is only visible
443 * via crypto_se_driver.h. */
444typedef uint64_t psa_key_slot_number_t;
445#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
446#endif /* !__DOXYGEN_ONLY__ */
447
460
463#endif /* PSA_CRYPTO_TYPES_H */
PSA cryptography module: Mbed TLS platform definitions.
uint16_t psa_key_type_t
Encoding of a key type.
Definition: crypto_types.h:81
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition: crypto_types.h:137
uint8_t psa_ecc_family_t
Definition: crypto_types.h:100
uint8_t psa_dh_family_t
Definition: crypto_types.h:119
uint16_t psa_key_derivation_step_t
Encoding of the step of a key derivation.
Definition: crypto_types.h:459
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:62
uint32_t psa_key_id_t
Definition: crypto_types.h:278
uint8_t psa_key_persistence_t
Definition: crypto_types.h:222
uint32_t psa_key_location_t
Definition: crypto_types.h:263
uint32_t psa_key_lifetime_t
Definition: crypto_types.h:186
psa_key_id_t mbedtls_svc_key_id_t
Definition: crypto_types.h:295
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
Definition: crypto_types.h:326
uint64_t psa_key_slot_number_t