Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/random/fortuna.c
Show First 20 Lines • Show All 365 Lines • ▼ Show 20 Lines | #ifdef _KERNEL | ||||
/* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */ | /* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */ | ||||
now = getsbinuptime(); | now = getsbinuptime(); | ||||
#endif | #endif | ||||
RANDOM_RESEED_LOCK(); | RANDOM_RESEED_LOCK(); | ||||
if (fortuna_state.fs_pool[0].fsp_length >= fortuna_state.fs_minpoolsize | if (fortuna_state.fs_pool[0].fsp_length >= fortuna_state.fs_minpoolsize | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */ | /* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */ | ||||
&& (now - fortuna_state.fs_lasttime > hz/10) | && (now - fortuna_state.fs_lasttime > SBT_1S/10) | ||||
#endif | #endif | ||||
) { | ) { | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
fortuna_state.fs_lasttime = now; | fortuna_state.fs_lasttime = now; | ||||
#endif | #endif | ||||
/* FS&K - ReseedCNT = ReseedCNT + 1 */ | /* FS&K - ReseedCNT = ReseedCNT + 1 */ | ||||
fortuna_state.fs_reseedcount++; | fortuna_state.fs_reseedcount++; | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |