diff options
| author | Mark Murray <markm@FreeBSD.org> | 2000-07-17 12:23:04 +0000 |
|---|---|---|
| committer | Mark Murray <markm@FreeBSD.org> | 2000-07-17 12:23:04 +0000 |
| commit | 720a3741cf8c06f597bac5a1a216b6018278dc89 (patch) | |
| tree | 16e98d700cd7410cc205c4fcfe45d099a0233554 /sys/dev/random/yarrow.c | |
| parent | e492a4c41acb5f4f91427d026414de4c36059963 (diff) | |
Notes
Diffstat (limited to 'sys/dev/random/yarrow.c')
| -rw-r--r-- | sys/dev/random/yarrow.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/random/yarrow.c b/sys/dev/random/yarrow.c index c6ae4481a0eb..e5174d9cc9b5 100644 --- a/sys/dev/random/yarrow.c +++ b/sys/dev/random/yarrow.c @@ -274,6 +274,25 @@ read_random(char *buf, u_int count) return retval; } +void +write_random(char *buf, u_int count) +{ + u_int i; + intrmask_t mask; + struct timespec nanotime; + + /* The reseed task must not be jumped on */ + mask = splsofttq(); + for (i = 0; i < count/sizeof(u_int64_t); i++) { + getnanotime(&nanotime); + random_harvest_internal(&nanotime, + *(u_int64_t *)&buf[i*sizeof(u_int64_t)], + 0, 0, RANDOM_WRITE); + } + reseed(FAST); + splx(mask); +} + static void generator_gate(void) { |
