Home | History | Annotate | Download | only in rndctl

Lines Matching refs:entropy

155 	/* Find how much entropy is in the pool.  */
186 * Report an upper bound on the min-entropy of the seed data.
187 * We take the larger of the system entropy and the extra
188 * entropy -- the system state and the extra input may or may
195 rs.entropy = MIN(MAX(systementropy, extraentropy),
199 * Compute the checksum on the 32-bit entropy count, followed
203 SHA1Update(&s, (const uint8_t *)&rs.entropy, sizeof(rs.entropy));
258 if (sysctlbyname("kern.entropy.consolidate", NULL, NULL,
260 warn("consolidate entropy");
300 * Additionally, we zero the seed's stored entropy estimate if
335 SHA1Update(&s, (const uint8_t *)&rs.entropy, sizeof(rs.entropy));
342 * entropy in case it was corrupted with predictable
346 rs.entropy = 0;
350 * If the entropy is insensibly large, try byte-swapping.
352 * has zero entropy.
354 if (howmany(rs.entropy, NBBY) > sizeof(rs.data)) {
355 rs.entropy = bswap32(rs.entropy);
356 if (howmany(rs.entropy, NBBY) > sizeof(rs.data)) {
357 warnx("bad entropy estimate");
358 rs.entropy = 0;
362 /* If the medium can't be updated, zero the entropy estimate. */
364 rs.entropy = 0;
366 /* Fail later on if there's no entropy in the seed. */
367 if (rs.entropy == 0) {
368 warnx("no entropy in seed");
372 /* If the user asked, zero the entropy estimate, but succeed. */
374 rs.entropy = 0;
381 * to have full entropy, so that the updated seed will
385 rd.entropy = rs.entropy;
402 rs.entropy) == -1)