blob: 81d7f4b3287701bcb4d4f64d021cc14a47df4312 [file] [log] [blame]
Tom Rini0344c602024-10-08 13:56:50 -06001/** \file psa_crypto_stubs.c
2 *
3 * \brief Stub functions when MBEDTLS_PSA_CRYPTO_CLIENT is enabled but
4 * MBEDTLS_PSA_CRYPTO_C is disabled.
5 */
6
7/*
8 * Copyright The Mbed TLS Contributors
9 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
10 */
11
12#include <psa/crypto.h>
13
14#if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
15
16psa_status_t psa_generate_random(uint8_t *output,
17 size_t output_size)
18{
19 (void) output;
20 (void) output_size;
21
22 return PSA_ERROR_COMMUNICATION_FAILURE;
23}
24
25psa_status_t psa_export_key(mbedtls_svc_key_id_t key,
26 uint8_t *data,
27 size_t data_size,
28 size_t *data_length)
29{
30 (void) key;
31 (void) data;
32 (void) data_size;
33 (void) data_length;
34 return PSA_ERROR_COMMUNICATION_FAILURE;
35}
36
37psa_status_t psa_export_public_key(mbedtls_svc_key_id_t key,
38 uint8_t *data,
39 size_t data_size,
40 size_t *data_length)
41{
42 (void) key;
43 (void) data;
44 (void) data_size;
45 (void) data_length;
46 return PSA_ERROR_COMMUNICATION_FAILURE;
47}
48
49psa_status_t psa_get_key_attributes(mbedtls_svc_key_id_t key,
50 psa_key_attributes_t *attributes)
51{
52 (void) key;
53 (void) attributes;
54 return PSA_ERROR_COMMUNICATION_FAILURE;
55}
56
57psa_status_t psa_hash_abort(psa_hash_operation_t *operation)
58{
59 (void) operation;
60 return PSA_ERROR_COMMUNICATION_FAILURE;
61}
62
63psa_status_t psa_import_key(const psa_key_attributes_t *attributes,
64 const uint8_t *data,
65 size_t data_length,
66 mbedtls_svc_key_id_t *key)
67{
68 (void) attributes;
69 (void) data;
70 (void) data_length;
71 (void) key;
72 return PSA_ERROR_COMMUNICATION_FAILURE;
73}
74
75#endif /* MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C */