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:
parent
0fbf163e60
commit
c6c7b2912c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/random_number_generator/; revision=255319
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user