Mbed TLS v3.6.7
Toggle main menu visibility
Loading...
Searching...
No Matches
crypto_compat.h
Go to the documentation of this file.
1
13
/*
14
* Copyright The Mbed TLS Contributors
15
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
16
*/
17
18
#ifndef PSA_CRYPTO_COMPAT_H
19
#define PSA_CRYPTO_COMPAT_H
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
/*
26
* To support both openless APIs and psa_open_key() temporarily, define
27
* psa_key_handle_t to be equal to mbedtls_svc_key_id_t. Do not mark the
28
* type and its utility macros and functions deprecated yet. This will be done
29
* in a subsequent phase.
30
*/
31
typedef
mbedtls_svc_key_id_t
psa_key_handle_t
;
32
33
#define PSA_KEY_HANDLE_INIT MBEDTLS_SVC_KEY_ID_INIT
34
41
static
inline
int
psa_key_handle_is_null
(
psa_key_handle_t
handle)
42
{
43
return
mbedtls_svc_key_id_is_null
(handle);
44
}
45
106
psa_status_t
psa_open_key
(
mbedtls_svc_key_id_t
key,
107
psa_key_handle_t
*handle);
108
147
psa_status_t
psa_close_key
(
psa_key_handle_t
handle);
148
152
153
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
161
#define PSA_DH_FAMILY_CUSTOM \
162
((psa_dh_family_t) MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(0x7e))
163
180
static
inline
psa_status_t
MBEDTLS_DEPRECATED
psa_set_key_domain_parameters
(
181
psa_key_attributes_t
*attributes,
182
psa_key_type_t
type,
const
uint8_t *data,
size_t
data_length)
183
{
184
(void) data;
185
if
(data_length != 0) {
186
return
PSA_ERROR_NOT_SUPPORTED
;
187
}
188
psa_set_key_type
(attributes, type);
189
return
PSA_SUCCESS
;
190
}
191
206
static
inline
psa_status_t
MBEDTLS_DEPRECATED
psa_get_key_domain_parameters
(
207
const
psa_key_attributes_t
*attributes,
208
uint8_t *data,
size_t
data_size,
size_t
*data_length)
209
{
210
(void) attributes;
211
(void) data;
212
(void) data_size;
213
*data_length = 0;
214
return
PSA_SUCCESS
;
215
}
216
220
#define PSA_KEY_DOMAIN_PARAMETERS_SIZE(key_type, key_bits) \
221
MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(1u)
222
#endif
/* MBEDTLS_DEPRECATED_REMOVED */
223
225
226
#ifdef __cplusplus
227
}
228
#endif
229
230
#endif
/* PSA_CRYPTO_COMPAT_H */
psa_key_handle_t
mbedtls_svc_key_id_t psa_key_handle_t
Definition
crypto_compat.h:31
psa_open_key
psa_status_t psa_open_key(mbedtls_svc_key_id_t key, psa_key_handle_t *handle)
psa_close_key
psa_status_t psa_close_key(psa_key_handle_t handle)
psa_key_handle_is_null
static int psa_key_handle_is_null(psa_key_handle_t handle)
Definition
crypto_compat.h:41
psa_key_attributes_t
struct psa_key_attributes_s psa_key_attributes_t
Definition
crypto_types.h:432
psa_set_key_type
static void psa_set_key_type(psa_key_attributes_t *attributes, psa_key_type_t type)
psa_set_key_domain_parameters
static psa_status_t MBEDTLS_DEPRECATED psa_set_key_domain_parameters(psa_key_attributes_t *attributes, psa_key_type_t type, const uint8_t *data, size_t data_length)
Set domain parameters for a key.
Definition
crypto_compat.h:180
psa_get_key_domain_parameters
static psa_status_t MBEDTLS_DEPRECATED psa_get_key_domain_parameters(const psa_key_attributes_t *attributes, uint8_t *data, size_t data_size, size_t *data_length)
Get domain parameters for a key.
Definition
crypto_compat.h:206
psa_key_type_t
uint16_t psa_key_type_t
Encoding of a key type.
Definition
crypto_types.h:78
psa_status_t
int32_t psa_status_t
Function return status.
Definition
crypto_types.h:59
PSA_ERROR_NOT_SUPPORTED
#define PSA_ERROR_NOT_SUPPORTED
Definition
crypto_values.h:73
PSA_SUCCESS
#define PSA_SUCCESS
Definition
crypto_values.h:57
mbedtls_svc_key_id_is_null
static int mbedtls_svc_key_id_is_null(mbedtls_svc_key_id_t key)
Definition
crypto_values.h:2473
mbedtls_svc_key_id_t
psa_key_id_t mbedtls_svc_key_id_t
Definition
crypto_types.h:292
MBEDTLS_DEPRECATED
#define MBEDTLS_DEPRECATED
Definition
platform_util.h:37
include
psa
crypto_compat.h
Generated on
for Mbed TLS v3.6.7 by
1.17.0