* (c) 1998 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Catacomb.
*
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
- *
+ *
* Catacomb is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Library General Public
* License along with Catacomb; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
/* --- @rand_goodbits@ --- *
*
- * Arguments: @rand_pool *r@ = pointer to a randomness pool
+ * Arguments: @rand_pool *r@ = pointer to a randomness pool
*
- * Returns: Estimate of the number of good bits remaining in the pool.
+ * Returns: Estimate of the number of good bits remaining in the pool.
*/
unsigned rand_goodbits(rand_pool *r)
case RAND_SEED:
case RAND_TIMER:
case RAND_GOODBITS:
+ case RAND_ADD:
rc = 1;
break;
default:
case RAND_GOODBITS:
rc = rand_goodbits(&g->p);
break;
+ case RAND_ADD: {
+ const void *p = va_arg(ap, const void *);
+ size_t sz = va_arg(ap, size_t);
+ unsigned goodbits = va_arg(ap, unsigned);
+ rand_add(&g->p, p, sz, goodbits);
+ } break;
default:
GRAND_BADOP;
break;