X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/ac2fd5cd29bd9485c6d49badc4ed8287f908b799..025c5f4aa5ffbf8948482a4233318db81c2df5d2:/rand.c diff --git a/rand.c b/rand.c index c3b777d..c50e10a 100644 --- a/rand.c +++ b/rand.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: rand.c,v 1.5 2000/06/17 11:53:55 mdw Exp $ + * $Id$ * * Secure random number generator * @@ -27,27 +27,6 @@ * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: rand.c,v $ - * Revision 1.5 2000/06/17 11:53:55 mdw - * Deprecate `rand_getgood'. Provide a new interface to ensure that a pool - * is well seeded. Use secure arena for memory allocation. - * - * Revision 1.4 1999/12/13 15:34:28 mdw - * Increase the entropy threshhold in rand_getgood. - * - * Revision 1.3 1999/12/10 23:28:07 mdw - * Bug fix: rand_getgood didn't update buffer pointer. - * - * Revision 1.2 1999/10/12 21:00:15 mdw - * Make pool and buffer sizes more sensible. - * - * Revision 1.1 1999/09/03 08:41:12 mdw - * Initial import. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -485,6 +464,8 @@ static int gmisc(grand *r, unsigned op, ...) case RAND_KEY: case RAND_NOISESRC: case RAND_SEED: + case RAND_TIMER: + case RAND_GOODBITS: rc = 1; break; default: @@ -528,6 +509,12 @@ static int gmisc(grand *r, unsigned op, ...) case RAND_SEED: rand_seed(&g->p, va_arg(ap, unsigned)); break; + case RAND_TIMER: + TIMER(&g->p); + break; + case RAND_GOODBITS: + rc = rand_goodbits(&g->p); + break; default: GRAND_BADOP; break;