1 /* 2 * include/linux/random.h 3 * 4 * Include file for the random number generator. 5 */ 6 7 /* 8 * We should always include the random number generator, since it's 9 * relatively small, and it's most useful when application developers 10 * can assume that all Linux systems have it. (Ideally, it would be 11 * best if we could assume that all Unix systems had it, but oh 12 * well....) 13 * 14 * Also, many kernel routines will have a use for good random numbers, 15 * for example, for truely random TCP sequence numbers, which prevent 16 * certain forms of TCP spoofing attacks. 17 */ 18 #define CONFIG_RANDOM 19 20 /* Exported functions */ 21 22 #ifdef CONFIG_RANDOM 23 void rand_initialize(void); 24 25 void add_keyboard_randomness(unsigned char scancode); 26 void add_interrupt_randomness(int irq); 27 28 void get_random_bytes(void *buf, int nbytes); 29 int read_random(struct inode * inode, struct file * file, 30 char * buf, int nbytes); 31 int read_random_unlimited(struct inode * inode, struct file * file, 32 char * buf, int nbytes); 33 #else 34 #define add_keyboard_randomness(x) 35 #define add_interrupt_randomness(x) 36 #endif