Yarrow wants entropy estimations to be conservative; the usual idea

is that if you are certain you have N bits of entropy, you declare
N/2.
This commit is contained in:
markm 2013-09-06 17:51:52 +00:00
parent 9d67aa8bff
commit d3a8919edc
6 changed files with 6 additions and 6 deletions

View File

@ -476,7 +476,7 @@ glxsb_rnd(void *v)
if (status & SB_RNS_TRNG_VALID) {
value = bus_read_4(sc->sc_sr, SB_RANDOM_NUM);
/* feed with one uint32 */
random_harvest(&value, 4, 32, 0, RANDOM_PURE);
random_harvest(&value, 4, 32/2, 0, RANDOM_PURE);
}
callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc);

View File

@ -258,7 +258,7 @@ hifn_partname(struct hifn_softc *sc)
static void
default_harvest(struct rndtest_state *rsp, void *buf, u_int count)
{
random_harvest(buf, count, count*NBBY, 0, RANDOM_PURE);
random_harvest(buf, count, count*NBBY/2, 0, RANDOM_PURE);
}
static u_int

View File

@ -152,7 +152,7 @@ rndtest_harvest(struct rndtest_state *rsp, void *buf, u_int len)
for (len /= sizeof (u_int32_t); len; len--)
add_true_randomness(*p++);
#else
random_harvest(buf, len, len*NBBY, 0, RANDOM_PURE);
random_harvest(buf, len, len*NBBY/2, 0, RANDOM_PURE);
#endif
}
}

View File

@ -211,7 +211,7 @@ safe_partname(struct safe_softc *sc)
static void
default_harvest(struct rndtest_state *rsp, void *buf, u_int count)
{
random_harvest(buf, count, count*NBBY, 0, RANDOM_PURE);
random_harvest(buf, count, count*NBBY/2, 0, RANDOM_PURE);
}
#endif /* SAFE_NO_RNG */

View File

@ -259,7 +259,7 @@ ubsec_partname(struct ubsec_softc *sc)
static void
default_harvest(struct rndtest_state *rsp, void *buf, u_int count)
{
random_harvest(buf, count, count*NBBY, 0, RANDOM_PURE);
random_harvest(buf, count, count*NBBY/2, 0, RANDOM_PURE);
}
static int

View File

@ -131,7 +131,7 @@ octeon_rnd_harvest(void *arg)
for (i = 0; i < OCTEON_RND_WORDS; i++)
sc->sc_entropy[i] = cvmx_rng_get_random64();
random_harvest(sc->sc_entropy, sizeof sc->sc_entropy,
sizeof sc->sc_entropy * 8, 0, RANDOM_PURE);
(sizeof(sc->sc_entropy)*8)/2, 0, RANDOM_PURE);
callout_reset(&sc->sc_callout, hz * 5, octeon_rnd_harvest, sc);
}