X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/099355bc239ba5c0c066be2924fbf0930744ee2f..8404fd750e8d1a635ccb3895e4f0e155e5f5e3cf:/noise.h diff --git a/noise.h b/noise.h index b8a0050..9252809 100644 --- a/noise.h +++ b/noise.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: noise.h,v 1.3 1999/12/22 15:57:55 mdw Exp $ + * $Id: noise.h,v 1.5 2004/04/02 01:03:49 mdw Exp $ * * Acquisition of environmental noise (Unix-specific) * @@ -30,6 +30,13 @@ /*----- Revision history --------------------------------------------------* * * $Log: noise.h,v $ + * Revision 1.5 2004/04/02 01:03:49 mdw + * Miscellaneous constification. + * + * Revision 1.4 2000/06/17 12:57:47 mdw + * New free counter noise generator, for use if /dev/random is + * unavailable. + * * Revision 1.3 1999/12/22 15:57:55 mdw * Label system-specific parts more clearly. * @@ -58,7 +65,7 @@ /*----- Noise source definition -------------------------------------------*/ -extern rand_source noise_source; +extern const rand_source noise_source; /*----- Magic numbers -----------------------------------------------------*/ @@ -133,6 +140,32 @@ extern void noise_setid(uid_t /*uid*/, gid_t /*gid*/); extern int noise_filter(rand_pool */*r*/, int /*good*/, const char */*c*/); +/* --- @noise_freewheel@ --- * + * + * Arguments: @rand_pool *r@ = pointer to a randomness pool + * + * Returns: Nonzero if some randomness was contributed. + * + * Use: Runs a free counter for a short while as a desparate attempt + * to get randomness from somewhere. This is actually quite + * effective. + */ + +int noise_freewheel(rand_pool */*r*/); + +/* --- @noise_enquire@ --- * + * + * Arguments: @rand_pool *r@ = pointer to a randomness pool + * + * Returns: Nonzero if some randomness was contributed. + * + * Use: Runs some shell commands to enquire about the prevailing + * environment. This can gather quite a lot of low-quality + * entropy. + */ + +extern int noise_enquire(rand_pool */*r*/); + /* --- @noise_acquire@ --- * * * Arguments: @rand_pool *r@ = pointer to a randomness pool