1 /*
2  *      $Id: random.h 191 2007-03-30 23:26:38Z boote $
3  */
4 /************************************************************************
5 *									*
6 *			     Copyright (C)  2002			*
7 *				Internet2				*
8 *			     All Rights Reserved			*
9 *									*
10 ************************************************************************/
11 /*
12  *	File:		random.h
13  *
14  *	Author:		Anatoly Karp
15  *	                Jeff W. Boote
16  *			Internet2
17  *
18  *	Date:		Sun Jun  2 12:19:22 MDT 2002
19  *
20  *	Description:
21  */
22 
23 #ifndef	_i2_random_h_
24 #define	_i2_random_h_
25 
26 #include <I2util/util.h>
27 #include <stdio.h>
28 #include <sys/types.h>
29 
30 #include <stdarg.h>
31 
32 /*
33 ** Types of randomness sources.
34 */
35 #define	I2RAND_UNINITIALIZED	0
36 #define	I2RAND_DEV	1
37 #define	I2RAND_EGD	2
38 
39 BEGIN_C_DECLS
40 
41 typedef struct I2RandomSourceRec	*I2RandomSource;
42 
43 extern I2RandomSource
44 I2RandomSourceInit(
45 	I2ErrHandle	eh,
46 	int		type,
47 	void*		data
48 	);
49 
50 extern int
51 I2RandomBytes(
52 	I2RandomSource	src,
53 	unsigned char	*ptr,
54 	int		count
55 	);
56 
57 extern void
58 I2RandomSourceClose(
59 	I2RandomSource	src
60 	);
61 
62 END_C_DECLS
63 
64 #endif	/* _i2_random_h_	*/
65