Lines Matching defs:entropy

18 /* $Id: entropy.c,v 1.22 2010/08/10 23:48:19 tbox Exp $ */
22 * This is the system independent part of the entropy module. It is
24 * \link unix/entropy.c unix/entropy.c \endlink or win32/entropy.c.
35 #include <isc/entropy.h>
62 * Size of entropy pool in 32-bit words. This _MUST_ be a power of 2.
94 isc_uint32_t entropy; /*%< current entropy estimate in bits */
144 isc_uint32_t total; /*%< entropy from this source */
223 * Add in entropy, even when the value we're adding in could be
227 add_entropy(isc_entropy_t *ent, isc_uint32_t entropy) {
229 entropy = ISC_MIN(entropy, RND_POOLBITS);
230 /* Add in the entropy we already have. */
231 entropy += ent->pool.entropy;
233 ent->pool.entropy = ISC_MIN(entropy, RND_POOLBITS);
237 * Decrement the amount of entropy the pool has.
240 subtract_entropy(isc_entropy_t *ent, isc_uint32_t entropy) {
241 entropy = ISC_MIN(entropy, ent->pool.entropy);
242 ent->pool.entropy -= entropy;
246 * Add in entropy, even when the value we're adding in could be
309 * Requires that the lock is held on the entropy pool.
313 isc_uint32_t entropy)
360 add_entropy(ent, entropy);
361 subtract_pseudo(ent, entropy);
424 * If any delta is 0, we got no entropy. If all are non-zero, we
571 * of entropy in the pool, don't block here. It is
576 if (ent->pool.entropy >= THRESHOLD_BITS)
582 * Verify that we got enough entropy to do one
585 if (ent->pool.entropy < THRESHOLD_BITS) {
626 deltae = ISC_MIN(deltae, ent->pool.entropy);
643 /* put the entropy we almost extracted back */
658 pool->entropy = 0;
667 pool->entropy = 0;
904 * Hook it into the entropy system.
983 * Hook it into the entropy system.
1028 unsigned int entropy;
1040 entropy = crunchsamples(ent, sq);
1041 add_entropy(ent, entropy);
1067 isc_uint32_t entropy)
1073 entropypool_adddata(ent, data, length, entropy);
1087 " rotate %u entropy %u pseudo %u nsources %u"
1091 ent->pool.entropy, ent->pool.pseudo,
1113 estimate = ent->pool.entropy;
1159 * entropy multiple times.
1171 "entropy, since your system is lacking\n"
1271 * final_result is ISC_R_SUCCESS if at least one source of entropy