2 * Noise generation for PuTTY's cryptographic random number
14 * This function is called once, at PuTTY startup, and will do some
15 * seriously silly things like listing directories and getting disk
16 * free space and a process snapshot.
19 void noise_get_heavy(void (*func) (void *, int))
22 read_random_seed(func);
23 /* Update the seed immediately, in case another instance uses it. */
27 void random_save_seed(void)
33 random_get_savedata(&data, &len);
34 write_random_seed(data, len);
40 * This function is called every time the random pool needs
41 * stirring, and will acquire the system time.
43 void noise_get_light(void (*func) (void *, int))
48 func(&utc, sizeof(utc));
52 * This function is called on every keypress or mouse move, and
53 * will add the current time to the noise pool. It gets the scan
54 * code or mouse position passed in, and adds that too.
56 void noise_ultralight(unsigned long data)
61 random_add_noise(&utc, sizeof(utc));
62 random_add_noise(&data, sizeof(data));
67 * c-file-style: "simon"