XenevaOS
Loading...
Searching...
No Matches
psa_crypto_invasive.h
Go to the documentation of this file.
1
11/*
12 * Copyright The Mbed TLS Contributors
13 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
14 */
15
16#ifndef PSA_CRYPTO_INVASIVE_H
17#define PSA_CRYPTO_INVASIVE_H
18
19/*
20 * Include the build-time configuration information header. Here, we do not
21 * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which
22 * is basically just an alias to it. This is to ease the maintenance of the
23 * TF-PSA-Crypto repository which has a different build system and
24 * configuration.
25 */
26#include "psa/build_info.h"
27
28#include "psa/crypto.h"
29#include "common.h"
30
31#include "mbedtls/entropy.h"
32
33#if !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
67 void (* entropy_init)(mbedtls_entropy_context *ctx),
68 void (* entropy_free)(mbedtls_entropy_context *ctx));
69#endif /* !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) */
70
71#if defined(MBEDTLS_TEST_HOOKS) && defined(MBEDTLS_PSA_CRYPTO_C)
72psa_status_t psa_mac_key_can_do(
73 psa_algorithm_t algorithm,
74 psa_key_type_t key_type);
75
76psa_status_t psa_crypto_copy_input(const uint8_t *input, size_t input_len,
77 uint8_t *input_copy, size_t input_copy_len);
78
79psa_status_t psa_crypto_copy_output(const uint8_t *output_copy, size_t output_copy_len,
80 uint8_t *output, size_t output_len);
81
82/*
83 * Test hooks to use for memory unpoisoning/poisoning in copy functions.
84 */
85extern void (*psa_input_pre_copy_hook)(const uint8_t *input, size_t input_len);
86extern void (*psa_input_post_copy_hook)(const uint8_t *input, size_t input_len);
87extern void (*psa_output_pre_copy_hook)(const uint8_t *output, size_t output_len);
88extern void (*psa_output_post_copy_hook)(const uint8_t *output, size_t output_len);
89
90#endif /* MBEDTLS_TEST_HOOKS && MBEDTLS_PSA_CRYPTO_C */
91
92#endif /* PSA_CRYPTO_INVASIVE_H */
Platform Security Architecture cryptography module.
unsigned char uint8_t
Definition acefiex.h:161
Utility macros for internal use in the library.
Entropy accumulator implementation.
uint16_t psa_key_type_t
Encoding of a key type.
Definition crypto_types.h:78
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Definition crypto_types.h:134
int32_t psa_status_t
Function return status.
Definition crypto_types.h:59
Build-time PSA configuration info.
psa_status_t mbedtls_psa_crypto_configure_entropy_sources(void(*entropy_init)(mbedtls_entropy_context *ctx), void(*entropy_free)(mbedtls_entropy_context *ctx))
Configure entropy sources.
Entropy context structure.
Definition entropy.h:106
struct VirtioInputEvent * input
Definition virtiokbd.c:46