blob: 1f6daa2f30a56a23b68677c40afd7c70624c2e18 [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
2 * \file havege.h
Paul Bakkere0ccd0a2009-01-04 16:27:10 +00003 *
4 * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine
5 *
Paul Bakker27db1f52009-01-25 15:27:00 +00006 * Copyright (C) 2009 Paul Bakker <polarssl_maintainer at polarssl dot org>
Paul Bakkere0ccd0a2009-01-04 16:27:10 +00007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Paul Bakker5121ce52009-01-03 21:22:43 +000021 */
Paul Bakker40e46942009-01-03 21:51:57 +000022#ifndef POLARSSL_HAVEGE_H
23#define POLARSSL_HAVEGE_H
Paul Bakker5121ce52009-01-03 21:22:43 +000024
25#define COLLECT_SIZE 1024
26
27/**
28 * \brief HAVEGE state structure
29 */
30typedef struct
31{
32 int PT1, PT2, offset[2];
33 int pool[COLLECT_SIZE];
34 int WALK[8192];
35}
36havege_state;
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42/**
43 * \brief HAVEGE initialization
44 *
45 * \param hs HAVEGE state to be initialized
46 */
47void havege_init( havege_state *hs );
48
49/**
50 * \brief HAVEGE rand function
51 *
52 * \param rng_st points to an HAVEGE state
53 *
54 * \return A random int
55 */
56int havege_rand( void *p_rng );
57
58#ifdef __cplusplus
59}
60#endif
61
62#endif /* havege.h */