blob: d9acbe5a5788f1be27228be1d324edf9fabc0dba [file] [log] [blame]
Paul Bakker6083fd22011-12-03 21:45:14 +00001/**
2 * \file entropy_poll.h
3 *
4 * \brief Platform-specific and custom entropy polling functions
5 *
6 * Copyright (C) 2006-2011, Brainspark B.V.
7 *
8 * This file is part of PolarSSL (http://www.polarssl.org)
9 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
10 *
11 * All rights reserved.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 */
27#ifndef POLARSSL_ENTROPY_POLL_H
28#define POLARSSL_ENTROPY_POLL_H
29
30#include <string.h>
31
32#include "config.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#if !defined(POLARSSL_NO_PLATFORM_ENTROPY)
39/**
40 * \brief Platform-specific entropy poll callback
41 */
42int platform_entropy_poll( void *data,
43 unsigned char *output, size_t len, size_t *olen );
44#endif
45
46#if defined(POLARSSL_HAVEGE_C)
47/**
48 * \brief HAVEGE based entropy poll callback
49 *
50 * Requires an HAVEGE state as its data pointer.
51 */
52int havege_poll( void *data,
53 unsigned char *output, size_t len, size_t *olen );
54#endif
55
56#if defined(POLARSSL_TIMING_C)
57/**
58 * \brief hardclock-based entropy poll callback
59 */
60int hardclock_poll( void *data,
61 unsigned char *output, size_t len, size_t *olen );
62#endif
63
64#ifdef __cplusplus
65}
66#endif
67
68#endif /* entropy_poll.h */