1/* Bob Jenkins's cryptographic random number generator, ISAAC.
2
3   Copyright (C) 1999-2005, 2009-2010 Free Software Foundation, Inc.
4   Copyright (C) 1997, 1998, 1999 Colin Plumb.
5
6   This program is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   This program is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19   Written by Colin Plumb.  */
20
21#ifndef RAND_ISAAC_H
22# define RAND_ISAAC_H
23
24# include <stdint.h>
25
26/* Size of the state tables to use.  ISAAC_LOG should be at least 3,
27   and smaller values give less security.  */
28# define ISAAC_LOG 8
29# define ISAAC_WORDS (1 << ISAAC_LOG)
30# define ISAAC_BYTES (ISAAC_WORDS * sizeof (uint32_t))
31
32/* RNG state variables.  The members of this structure are private.  */
33struct isaac_state
34  {
35    uint32_t mm[ISAAC_WORDS];	/* Main state array */
36    uint32_t iv[8];		/* Seeding initial vector */
37    uint32_t a, b, c;		/* Extra index variables */
38  };
39
40void isaac_seed (struct isaac_state *);
41void isaac_refill (struct isaac_state *, uint32_t[ISAAC_WORDS]);
42
43#endif
44