TuyaOS
crypto_compat.h
浏览该文件的文档.
1
13/*
14 * Copyright The Mbed TLS Contributors
15 * SPDX-License-Identifier: Apache-2.0
16 *
17 * Licensed under the Apache License, Version 2.0 (the "License"); you may
18 * not use this file except in compliance with the License.
19 * You may obtain a copy of the License at
20 *
21 * http://www.apache.org/licenses/LICENSE-2.0
22 *
23 * Unless required by applicable law or agreed to in writing, software
24 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
25 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26 * See the License for the specific language governing permissions and
27 * limitations under the License.
28 */
29
30#ifndef PSA_CRYPTO_COMPAT_H
31#define PSA_CRYPTO_COMPAT_H
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/*
38 * To support both openless APIs and psa_open_key() temporarily, define
39 * psa_key_handle_t to be equal to mbedtls_svc_key_id_t. Do not mark the
40 * type and its utility macros and functions deprecated yet. This will be done
41 * in a subsequent phase.
42 */
43typedef mbedtls_svc_key_id_t psa_key_handle_t;
44
45#define PSA_KEY_HANDLE_INIT MBEDTLS_SVC_KEY_ID_INIT
46
53static inline int psa_key_handle_is_null( psa_key_handle_t handle )
54{
55 return( mbedtls_svc_key_id_is_null( handle ) );
56}
57
118psa_status_t psa_open_key( mbedtls_svc_key_id_t key,
119 psa_key_handle_t *handle );
120
159psa_status_t psa_close_key(psa_key_handle_t handle);
160
161#ifdef __cplusplus
162}
163#endif
164
165#endif /* PSA_CRYPTO_COMPAT_H */
psa_status_t psa_open_key(mbedtls_svc_key_id_t key, psa_key_handle_t *handle)
psa_status_t psa_close_key(psa_key_handle_t handle)
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:63