seq no longer mishandles cases like "seq 0 0.000001 0.000003",
[coreutils/ericb.git] / lib / rand-isaac.h
blobf8daee03ddc059edc8a6a46b57de29a50b644934
1 /* Bob Jenkins's cryptographic random number generator, ISAAC.
3 Copyright (C) 1999-2005 Free Software Foundation, Inc.
4 Copyright (C) 1997, 1998, 1999 Colin Plumb.
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 2, or (at your option)
9 any later version.
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.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software Foundation,
18 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 Written by Colin Plumb. */
22 #ifndef RAND_ISAAC_H
23 # define RAND_ISAAC_H
25 # include <stdint.h>
27 /* Size of the state tables to use. ISAAC_LOG should be at least 3,
28 and smaller values give less security. */
29 # define ISAAC_LOG 8
30 # define ISAAC_WORDS (1 << ISAAC_LOG)
31 # define ISAAC_BYTES (ISAAC_WORDS * sizeof (uint32_t))
33 /* RNG state variables. The members of this structure are private. */
34 struct isaac_state
36 uint32_t mm[ISAAC_WORDS]; /* Main state array */
37 uint32_t iv[8]; /* Seeding initial vector */
38 uint32_t a, b, c; /* Extra index variables */
41 void isaac_seed (struct isaac_state *);
42 void isaac_refill (struct isaac_state *, uint32_t[ISAAC_WORDS]);
44 #endif