1 /* rand-internal.h - header to glue the random functions
2 * Copyright (C) 1998 Free Software Foundation, Inc.
4 * This file is part of GNUPG.
6 * GNUPG 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 of the License, or
9 * (at your option) any later version.
11 * GNUPG 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
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 #ifndef G10_RAND_INTERNAL_H
21 #define G10_RAND_INTERNAL_H
23 /* For now we use the DUMMY random generator if we do not have
24 * the real random device */
25 #ifndef HAVE_DEV_RANDOM
26 #define USE_RAND_DUMMY 1
35 #define BLOCKLEN 64 /* hash this amount of bytes */
36 #define DIGESTLEN 20 /* into a digest of this length (rmd160) */
37 /* poolblocks is the number of digests which make up the pool
38 * and poolsize must be a multiple of the digest length
39 * to make the AND operations faster, the size should also be
43 #define POOLSIZE (POOLBLOCKS*DIGESTLEN)
44 #if (POOLSIZE % SIZEOF_UNSIGNED_LONG)
45 #error Please make sure that poolsize is a multiple of ulong
47 #define POOLWORDS (POOLSIZE / SIZEOF_UNSIGNED_LONG)
50 void read_random_source( byte *buffer, size_t length, int level );
53 #endif /*G10_RAND_INTERNAL_H*/