mbed TLS v2.23.0

crypto_entropy_driver.h
Go to the documentation of this file.
1
14 /*
15 * Copyright (C) 2018, ARM Limited, All Rights Reserved
16 * SPDX-License-Identifier: Apache-2.0
17 *
18 * Licensed under the Apache License, Version 2.0 (the "License"); you may
19 * not use this file except in compliance with the License.
20 * You may obtain a copy of the License at
21 *
22 * http://www.apache.org/licenses/LICENSE-2.0
23 *
24 * Unless required by applicable law or agreed to in writing, software
25 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
26 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27 * See the License for the specific language governing permissions and
28 * limitations under the License.
29 */
30 #ifndef PSA_CRYPTO_ENTROPY_DRIVER_H
31 #define PSA_CRYPTO_ENTROPY_DRIVER_H
32
33 #include "crypto_driver_common.h"
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
52 typedef psa_status_t (*psa_drv_entropy_init_t)(void *p_context);
53
80 typedef psa_status_t (*psa_drv_entropy_get_bits_t)(void *p_context,
81 uint8_t *p_buffer,
82 uint32_t buffer_size,
83 uint32_t *p_received_entropy_bits);
84
94 typedef struct {
96 const size_t context_size;
98 psa_drv_entropy_init_t p_init;
100 psa_drv_entropy_get_bits_t p_get_bits;
101 } psa_drv_entropy_t;
104 #ifdef __cplusplus
105 }
106 #endif
107
108 #endif /* PSA_CRYPTO_ENTROPY_DRIVER_H */
psa_status_t
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:55
crypto_driver_common.h
Definitions for all PSA crypto drivers.
psa_drv_entropy_t::context_size
const size_t context_size
Definition: crypto_entropy_driver.h:96
psa_drv_entropy_t::p_init
psa_drv_entropy_init_t p_init
Definition: crypto_entropy_driver.h:98
psa_drv_entropy_t
A struct containing all of the function pointers needed to interface to an entropy source.
Definition: crypto_entropy_driver.h:94
psa_drv_entropy_init_t
psa_status_t(* psa_drv_entropy_init_t)(void *p_context)
Initialize an entropy driver.
Definition: crypto_entropy_driver.h:52
psa_drv_entropy_get_bits_t
psa_status_t(* psa_drv_entropy_get_bits_t)(void *p_context, uint8_t *p_buffer, uint32_t buffer_size, uint32_t *p_received_entropy_bits)
Get a specified number of bits from the entropy source.
Definition: crypto_entropy_driver.h:80
psa_drv_entropy_t::p_get_bits
psa_drv_entropy_get_bits_t p_get_bits
Definition: crypto_entropy_driver.h:100