Lines Matching defs:entropy

9 /* $Id: entropy.c,v 1.22 2010/08/10 23:48:19 tbox Exp $ */
13 * This is the system independent part of the entropy module. It is
15 * \link unix/entropy.c unix/entropy.c \endlink or win32/entropy.c.
26 #include <isc/entropy.h>
58 * Size of entropy pool in 32-bit words. This _MUST_ be a power of 2.
90 isc_uint32_t entropy; /*%< current entropy estimate in bits */
140 isc_uint32_t total; /*%< entropy from this source */
219 * Add in entropy, even when the value we're adding in could be
223 add_entropy(isc_entropy_t *ent, isc_uint32_t entropy) {
225 entropy = ISC_MIN(entropy, RND_POOLBITS);
226 /* Add in the entropy we already have. */
227 entropy += ent->pool.entropy;
229 ent->pool.entropy = ISC_MIN(entropy, RND_POOLBITS);
233 * Decrement the amount of entropy the pool has.
236 subtract_entropy(isc_entropy_t *ent, isc_uint32_t entropy) {
237 entropy = ISC_MIN(entropy, ent->pool.entropy);
238 ent->pool.entropy -= entropy;
242 * Add in entropy, even when the value we're adding in could be
305 * Requires that the lock is held on the entropy pool.
309 isc_uint32_t entropy)
365 add_entropy(ent, entropy);
366 subtract_pseudo(ent, entropy);
429 * If any delta is 0, we got no entropy. If all are non-zero, we
576 * of entropy in the pool, don't block here. It is
581 if (ent->pool.entropy >= THRESHOLD_BITS)
587 * Verify that we got enough entropy to do one
590 if (ent->pool.entropy < THRESHOLD_BITS) {
631 deltae = ISC_MIN(deltae, ent->pool.entropy);
648 /* put the entropy we almost extracted back */
663 pool->entropy = 0;
672 pool->entropy = 0;
908 * Hook it into the entropy system.
987 * Hook it into the entropy system.
1032 unsigned int entropy;
1044 entropy = crunchsamples(ent, sq);
1045 add_entropy(ent, entropy);
1071 isc_uint32_t entropy)
1077 entropypool_adddata(ent, data, length, entropy);
1091 " rotate %u entropy %u pseudo %u nsources %u"
1095 ent->pool.entropy, ent->pool.pseudo,
1117 estimate = ent->pool.entropy;
1163 * entropy multiple times.
1175 "entropy, since your system is lacking\n"
1280 * final_result is ISC_R_SUCCESS if at least one source of entropy