2 .\" Copyright (c) 2002-2015 Mark R V Murray
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
21 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .Nd gather entropy from the kernel for the entropy device
36 .Fo random_harvest_direct
39 .Fa "enum esource source"
42 .Fo random_harvest_fast
45 .Fa "enum esource source"
48 .Fo random_harvest_queue
51 .Fa "enum esource source"
56 functions are used by device drivers
57 and other kernel processes to pass data
58 that is considered (at least partially) stochastic
59 to the entropy device.
61 The caller should pass
62 a pointer pointing to the
68 contains the number of bytes pointed to.
72 the values enumerated in
73 .Pa sys/dev/random.h .
74 and is used to indicate the source of the entropy.
77 .Fo random_harvest_direct
81 before any multitasking
85 .Fn random_harvest_fast
93 Some entropy is sacrificed,
94 but the high rate of supply
95 will compensate for this.
98 .Fn random_harvest_queue
100 for general harvesting
102 choice for most entropy sources
106 Interrupt harvesting has been
108 for the kernel programmer.
109 If a device driver registers an interrupt handler
113 .Xr bus_setup_intr 9 ,
114 then it is only necessary to
119 argument to have that interrupt source
120 be used for entropy harvesting.
121 This should be done wherever practicable.
129 entropy device and supporting documentation was written by
130 .An Mark R V Murray .