Loading...
Searching...
No Matches
entropy_sources_mbedtls_riot.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 HAW Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
27typedef struct {
28 mbedtls_entropy_f_source_ptr func;
29 int strong;
33
45int riot_add_entropy_src_avail(mbedtls_entropy_context *ctx);
46
59int riot_hwrng_poll(void *data, unsigned char *output, size_t len,
60 size_t *olen);
61
75int riot_adc_poll(void *data, unsigned char *output, size_t len,
76 size_t *olen);
77
78#if !defined(MODULE_MBEDTLS_ENTROPY_SOURCE_HWRNG) && \
79 !defined(MODULE_ENTROPY_SOURCE_ADC_NOISE)
80#error "You must enable at least one entropy source. Currently supported are \
81 HWRNG and ADC_NOISE"
82#endif
83
84#ifdef __cplusplus
85}
86#endif
int riot_hwrng_poll(void *data, unsigned char *output, size_t len, size_t *olen)
Wrapper around RIOTs HWRNG API.
int riot_add_entropy_src_avail(mbedtls_entropy_context *ctx)
Add all available entropy sources to poll.
int riot_adc_poll(void *data, unsigned char *output, size_t len, size_t *olen)
Wrapper around RIOTs ADC entropy API.
Structure containing entropy function and its strength.
mbedtls_entropy_f_source_ptr func
Pointer to entropy callback func.
int strong
Strength of the entropy function (strong=1 for high entropy sources, strong=0 for weak entropy source...