Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/random_harvest.9
Show All 19 Lines | |||||
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||||
.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||||
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd July 13, 2015 | .Dd August 23, 2018 XXXX FIXME!!! | ||||
markm: Reminder to self to fix this. | |||||
.Dt RANDOM_HARVEST 9 | .Dt RANDOM_HARVEST 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm random_harvest | .Nm random_harvest | ||||
.Nd gather entropy from the kernel for the entropy device | .Nd gather entropy from the kernel for the entropy device | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/types.h | .In sys/types.h | ||||
.In sys/random.h | .In sys/random.h | ||||
.Ft void | .Ft void | ||||
.Fo random_harvest_direct | .Fo random_harvest_direct | ||||
.Fa "void *entropy" | .Fa "void *entropy" | ||||
.Fa "u_int size" | .Fa "u_int size" | ||||
.Fa "u_int bits" | |||||
Not Done Inline ActionsOh, I did not realize we would also be changing the API, but that makes sense. cem: Oh, I did not realize we would also be changing the API, but that makes sense. | |||||
.Fa "enum esource source" | .Fa "enum esource source" | ||||
.Fc | .Fc | ||||
.Ft void | .Ft void | ||||
.Fo random_harvest_fast | .Fo random_harvest_fast | ||||
.Fa "void *entropy" | .Fa "void *entropy" | ||||
.Fa "u_int size" | .Fa "u_int size" | ||||
.Fa "u_int bits" | |||||
.Fa "enum esource source" | .Fa "enum esource source" | ||||
.Fc | .Fc | ||||
.Ft void | .Ft void | ||||
.Fo random_harvest_queue | .Fo random_harvest_queue | ||||
.Fa "void *entropy" | .Fa "void *entropy" | ||||
.Fa "u_int size" | .Fa "u_int size" | ||||
.Fa "u_int bits" | |||||
.Fa "enum esource source" | .Fa "enum esource source" | ||||
.Fc | .Fc | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Fn random_harvest_* | .Fn random_harvest_* | ||||
functions are used by device drivers | functions are used by device drivers | ||||
and other kernel processes to pass data | and other kernel processes to pass data | ||||
that is considered (at least partially) stochastic | that is considered (at least partially) stochastic | ||||
Show All 38 Lines | |||||
The | The | ||||
.Fn random_harvest_queue | .Fn random_harvest_queue | ||||
variant is used | variant is used | ||||
for general harvesting | for general harvesting | ||||
and is the default | and is the default | ||||
choice for most entropy sources | choice for most entropy sources | ||||
such as interrupts | such as interrupts | ||||
or console events. | or console events. | ||||
.Pp | |||||
The | |||||
.Fa bits | |||||
argument is only used | |||||
by the deprecated Yarrow algorithm. | |||||
For compatibility, | |||||
the caller should | |||||
.Em "very conservatively" | |||||
estimate the number of random bits | |||||
in the sample, | |||||
and pass this in | |||||
.Fa bits . | |||||
.Pp | .Pp | ||||
Interrupt harvesting has been | Interrupt harvesting has been | ||||
in part simplified | in part simplified | ||||
for the kernel programmer. | for the kernel programmer. | ||||
If a device driver registers an interrupt handler | If a device driver registers an interrupt handler | ||||
with | with | ||||
.Xr BUS_SETUP_INTR 9 | .Xr BUS_SETUP_INTR 9 | ||||
or | or | ||||
Show All 18 Lines |
Reminder to self to fix this.