From 809c1f1e3914ba2c22206da2d027ca49305f6bd7 Mon Sep 17 00:00:00 2001 From: mdw Date: Sat, 17 Jun 2000 11:53:38 +0000 Subject: [PATCH] Deprecate `rand_getgood'. Provide a new interface to ensure that a pool is well seeded. --- rand.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/rand.h b/rand.h index 2f23440..566f927 100644 --- a/rand.h +++ b/rand.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: rand.h,v 1.5 1999/12/13 15:34:15 mdw Exp $ + * $Id: rand.h,v 1.6 2000/06/17 11:53:38 mdw Exp $ * * Secure random number generator * @@ -30,6 +30,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: rand.h,v $ + * Revision 1.6 2000/06/17 11:53:38 mdw + * Deprecate `rand_getgood'. Provide a new interface to ensure that a pool + * is well seeded. + * * Revision 1.5 1999/12/13 15:34:15 mdw * Fix a typo. * @@ -172,6 +176,21 @@ extern void rand_init(rand_pool */*r*/); extern void rand_noisesrc(rand_pool */*r*/, const rand_source */*s*/); +/* --- @rand_seed@ --- * + * + * Arguments: @rand_pool *r@ = pointer to a randomness pool + * @unsigned bits@ = number of bits to ensure + * + * Returns: --- + * + * Use: Ensures that there are at least @bits@ good bits of entropy + * in the pool. It is recommended that you call this after + * initializing a new pool. Requesting @bits > RAND_IBITS@ is + * doomed to failure (and is an error). + */ + +extern void rand_seed(rand_pool */*r*/, unsigned /*bits*/); + /* --- @rand_key@ --- * * * Arguments: @rand_pool *r@ = pointer to a randomness pool @@ -287,7 +306,8 @@ enum { RAND_GATE = GRAND_SPECIFIC, /* No args */ RAND_STRETCH, /* No args */ RAND_KEY, /* @const void *k, size_t sz@ */ - RAND_NOISESRC /* @const rand_source *s@ */ + RAND_NOISESRC, /* @const rand_source *s@ */ + RAND_SEED, /* @unsigned bits@ */ }; /* --- Default random number generator --- */ -- 2.11.0