]>
git.zerfleddert.de Git - proxmark3-svn/blob - common/mbedtls/entropy_poll.h
4 * \brief Platform-specific and custom entropy polling functions
7 * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
8 * SPDX-License-Identifier: GPL-2.0
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * This file is part of mbed TLS (https://tls.mbed.org)
26 #ifndef MBEDTLS_ENTROPY_POLL_H
27 #define MBEDTLS_ENTROPY_POLL_H
29 #if !defined(MBEDTLS_CONFIG_FILE)
32 #include MBEDTLS_CONFIG_FILE
42 * Default thresholds for built-in sources, in bytes
44 #define MBEDTLS_ENTROPY_MIN_PLATFORM 32 /**< Minimum for platform source */
45 #define MBEDTLS_ENTROPY_MIN_HAVEGE 32 /**< Minimum for HAVEGE */
46 #define MBEDTLS_ENTROPY_MIN_HARDCLOCK 4 /**< Minimum for mbedtls_timing_hardclock() */
47 #if !defined(MBEDTLS_ENTROPY_MIN_HARDWARE)
48 #define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Minimum for the hardware source */
52 * \brief Entropy poll callback that provides 0 entropy.
54 #if defined(MBEDTLS_TEST_NULL_ENTROPY)
55 int mbedtls_null_entropy_poll( void *data
,
56 unsigned char *output
, size_t len
, size_t *olen
);
59 #if !defined(MBEDTLS_NO_PLATFORM_ENTROPY)
61 * \brief Platform-specific entropy poll callback
63 int mbedtls_platform_entropy_poll( void *data
,
64 unsigned char *output
, size_t len
, size_t *olen
);
67 #if defined(MBEDTLS_HAVEGE_C)
69 * \brief HAVEGE based entropy poll callback
71 * Requires an HAVEGE state as its data pointer.
73 int mbedtls_havege_poll( void *data
,
74 unsigned char *output
, size_t len
, size_t *olen
);
77 #if defined(MBEDTLS_TIMING_C)
79 * \brief mbedtls_timing_hardclock-based entropy poll callback
81 int mbedtls_hardclock_poll( void *data
,
82 unsigned char *output
, size_t len
, size_t *olen
);
85 #if defined(MBEDTLS_ENTROPY_HARDWARE_ALT)
87 * \brief Entropy poll callback for a hardware source
89 * \warning This is not provided by mbed TLS!
90 * See \c MBEDTLS_ENTROPY_HARDWARE_ALT in config.h.
92 * \note This must accept NULL as its first argument.
94 int mbedtls_hardware_poll( void *data
,
95 unsigned char *output
, size_t len
, size_t *olen
);
98 #if defined(MBEDTLS_ENTROPY_NV_SEED)
100 * \brief Entropy poll callback for a non-volatile seed file
102 * \note This must accept NULL as its first argument.
104 int mbedtls_nv_seed_poll( void *data
,
105 unsigned char *output
, size_t len
, size_t *olen
);
112 #endif /* entropy_poll.h */