1
/* rand-internal.h - header to glue the random functions
2
* Copyright (C) 1998, 2002 Free Software Foundation, Inc.
4
* This file is part of Libgcrypt.
6
* Libgcrypt is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser general Public License as
8
* published by the Free Software Foundation; either version 2.1 of
9
* the License, or (at your option) any later version.
11
* Libgcrypt 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 Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License 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
24
/* Constants used to define the origin of random added to the pool.
25
The code is sensitive to the order of the values. */
28
RANDOM_ORIGIN_INIT = 0, /* Used only for initialization. */
29
RANDOM_ORIGIN_EXTERNAL = 1, /* Added from an external source. */
30
RANDOM_ORIGIN_FASTPOLL = 2, /* Fast random poll function. */
31
RANDOM_ORIGIN_SLOWPOLL = 3, /* Slow poll function. */
32
RANDOM_ORIGIN_EXTRAPOLL = 4 /* Used to mark an extra pool seed
33
due to a GCRY_VERY_STRONG_RANDOM
40
void _gcry_random_progress (const char *what, int printchar,
41
int current, int total);
44
int _gcry_rndlinux_gather_random (void (*add) (const void *, size_t,
46
enum random_origins origin,
47
size_t length, int level);
48
int _gcry_rndunix_gather_random (void (*add) (const void *, size_t,
50
enum random_origins origin,
51
size_t length, int level);
52
int _gcry_rndegd_gather_random (void (*add) (const void *, size_t,
54
enum random_origins origin,
55
size_t length, int level);
56
int _gcry_rndegd_connect_socket (int nofail);
57
int _gcry_rndw32_gather_random (void (*add) (const void *, size_t,
59
enum random_origins origin,
60
size_t length, int level);
61
void _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
63
enum random_origins origin );
65
int _gcry_rndhw_failed_p (void);
66
void _gcry_rndhw_poll_fast (void (*add)(const void*, size_t,
68
enum random_origins origin);
69
size_t _gcry_rndhw_poll_slow (void (*add)(const void*, size_t,
71
enum random_origins origin);
75
#endif /*G10_RAND_INTERNAL_H*/