Loading...
Searching...
No Matches
crypto_types.h
Go to the documentation of this file.
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#ifndef PSA_CRYPTO_TYPES_H
#define PSA_CRYPTO_TYPES_H
/*
* Include the build-time configuration information header. Here, we do not
* include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which
* is basically just an alias to it. This is to ease the maintenance of the
* TF-PSA-Crypto repository which has a different build system and
* configuration.
*/
#include "psa/build_info.h"
/* Define the MBEDTLS_PRIVATE macro. */
#include "mbedtls/private_access.h"
#if defined(MBEDTLS_PSA_CRYPTO_PLATFORM_FILE)
#include MBEDTLS_PSA_CRYPTO_PLATFORM_FILE
#else
#include "crypto_platform.h"
#endif
#include <stdint.h>
/* If #PSA_SUCCESS is already defined, it means that #psa_status_t
* is also defined in an external header, so prevent its multiple
* definition.
*/
#ifndef PSA_SUCCESS
typedef int32_t psa_status_t;
#endif
typedef uint16_t psa_key_type_t;
typedef uint8_t psa_ecc_family_t;
typedef uint8_t psa_dh_family_t;
typedef uint32_t psa_algorithm_t;
typedef uint32_t psa_key_lifetime_t;
typedef uint8_t psa_key_persistence_t;
typedef uint32_t psa_key_location_t;
typedef uint32_t psa_key_id_t;
#if !defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER)
typedef psa_key_id_t mbedtls_svc_key_id_t;
#else /* MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
/* Implementation-specific: The Mbed TLS library can be built as
* part of a multi-client service that exposes the PSA Cryptography API in each
* client and encodes the client identity in the key identifier argument of
* functions such as psa_open_key().
*/
typedef struct {
psa_key_id_t MBEDTLS_PRIVATE(key_id);
mbedtls_key_owner_id_t MBEDTLS_PRIVATE(owner);
} mbedtls_svc_key_id_t;
#endif /* !MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER */
typedef uint32_t psa_key_usage_t;
typedef struct psa_key_attributes_s psa_key_attributes_t;
#ifndef __DOXYGEN_ONLY__
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
/* Mbed TLS defines this type in crypto_types.h because it is also
* visible to applications through an implementation-specific extension.
* For the PSA Cryptography specification, this type is only visible
* via crypto_se_driver.h. */
typedef uint64_t psa_key_slot_number_t;
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
#endif /* !__DOXYGEN_ONLY__ */
typedef uint16_t psa_key_derivation_step_t;
typedef struct psa_custom_key_parameters_s psa_custom_key_parameters_t;
typedef struct psa_key_production_parameters_s psa_key_production_parameters_t;
#endif /* PSA_CRYPTO_TYPES_H */
crypto_platform.h
PSA cryptography module: Mbed TLS platform definitions.
psa_key_type_t
uint16_t psa_key_type_t
Encoding of a key type.
Definition crypto_types.h:78
psa_algorithm_t
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition crypto_types.h:134
psa_ecc_family_t
uint8_t psa_ecc_family_t
Definition crypto_types.h:97
psa_dh_family_t
uint8_t psa_dh_family_t
Definition crypto_types.h:116
psa_key_derivation_step_t
uint16_t psa_key_derivation_step_t
Encoding of the step of a key derivation.
Definition crypto_types.h:456
psa_status_t
int32_t psa_status_t
Function return status.
Definition crypto_types.h:59
psa_key_id_t
uint32_t psa_key_id_t
Definition crypto_types.h:275
psa_key_persistence_t
uint8_t psa_key_persistence_t
Definition crypto_types.h:219
psa_key_location_t
uint32_t psa_key_location_t
Definition crypto_types.h:260
psa_key_lifetime_t
uint32_t psa_key_lifetime_t
Definition crypto_types.h:183
mbedtls_svc_key_id_t
psa_key_id_t mbedtls_svc_key_id_t
Definition crypto_types.h:292
psa_key_usage_t
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
Definition crypto_types.h:323
psa_key_slot_number_t
uint64_t psa_key_slot_number_t
Definition crypto_se_driver.h:137
private_access.h
Macro wrapper for struct's members.
MBEDTLS_PRIVATE
#define MBEDTLS_PRIVATE(member)
Definition private_access.h:15
build_info.h
Build-time PSA configuration info.
psa_custom_key_parameters_s
Definition crypto_struct.h:226
psa_key_attributes_s
Definition crypto_struct.h:295
psa_key_production_parameters_s
Definition crypto_struct.h:252