From 32b87c5979a0e70994e4db65415ec0a2349c5618 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 1 Mar 2016 10:55:20 +0100 Subject: Add more man pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- man/zrand.3 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 man/zrand.3 (limited to 'man/zrand.3') diff --git a/man/zrand.3 b/man/zrand.3 new file mode 100644 index 0000000..c7858a1 --- /dev/null +++ b/man/zrand.3 @@ -0,0 +1,54 @@ +.TH ZRAND 3 libzahl +.SH NAME +zrand - Generate random a number +.SH SYNOPSIS +.nf +#include + +void zrand(z_t \fIr\fP, enum zranddev \fIdev\fP, enum zranddist \fIdist\fP, z_t \fImax\fP); +.fi +.SH DESCRIPTION +.B zrand +generates a random number and stores it in +.IR r . +.P +.I dev +selects the device +.B zrand +uses to generate random bits. +This value may be either of: +.TP +.B FAST_RANDOM +The fast, non-blocking random number generator. +This is /dev/urandom on Linux. +.TP +.B SECURE_RANDOM +The secure, blocking random number generator. +This is /dev/random on Linux. +.P +.I dist +selects the probably distribution of the +output +.IR r : +.TP +.B QUASIUNIFORM +Use the method of generation that is often +recommended for generating uniformally random +integers. This method has unnecessary +computational overhead and is not properly +uniform, but is is guaranteed to run in +constant time assuming the underlying device +for random bit generation does. + +The generated number if be in the inclusive +range [0, +.IR max ]. +.TP +.B UNIFORM +Generate a integer in the range [0, +.IR max ] +uniformally random. +.P +It is safe to call +.B zrand +with non-unique parameters. -- cgit v1.2.3-70-g09d2