Lines 55-60
Link Here
|
55 |
#include <machine/atomic.h> |
55 |
#include <machine/atomic.h> |
56 |
#include <machine/cpu.h> |
56 |
#include <machine/cpu.h> |
57 |
|
57 |
|
|
|
58 |
#include <crypto/rijndael/rijndael-api-fst.h> |
59 |
#include <crypto/sha2/sha256.h> |
60 |
|
61 |
#include <dev/random/hash.h> |
58 |
#include <dev/random/randomdev.h> |
62 |
#include <dev/random/randomdev.h> |
59 |
#include <dev/random/random_harvestq.h> |
63 |
#include <dev/random/random_harvestq.h> |
60 |
|
64 |
|
Lines 209-214
Link Here
|
209 |
/* It's an indenting error. Yeah, Yeah. */ |
213 |
/* It's an indenting error. Yeah, Yeah. */ |
210 |
#endif |
214 |
#endif |
211 |
local_read_rate = atomic_readandclear_32(&read_rate); |
215 |
local_read_rate = atomic_readandclear_32(&read_rate); |
|
|
216 |
/* Don't waste CPU cycles hashing more than the generator can use */ |
217 |
if (local_read_rate > RANDOM_KEYSIZE_WORDS - 1) |
218 |
local_read_rate = RANDOM_KEYSIZE_WORDS - 1; |
212 |
LIST_FOREACH(rrs, &source_list, rrs_entries) { |
219 |
LIST_FOREACH(rrs, &source_list, rrs_entries) { |
213 |
for (i = 0; i < p_random_alg_context->ra_poolcount*(local_read_rate + 1); i++) { |
220 |
for (i = 0; i < p_random_alg_context->ra_poolcount*(local_read_rate + 1); i++) { |
214 |
n = rrs->rrs_source->rs_read(entropy, sizeof(entropy)); |
221 |
n = rrs->rrs_source->rs_read(entropy, sizeof(entropy)); |