Blame doc/man3/RAND_add.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
RAND_add, RAND_poll, RAND_seed, RAND_status, RAND_event, RAND_screen,
Packit c4476c
RAND_keep_random_devices_open
Packit c4476c
- add randomness to the PRNG or get its status
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/rand.h>
Packit c4476c
Packit c4476c
 int RAND_status(void);
Packit c4476c
 int RAND_poll();
Packit c4476c
Packit c4476c
 void RAND_add(const void *buf, int num, double randomness);
Packit c4476c
 void RAND_seed(const void *buf, int num);
Packit c4476c
Packit c4476c
 void RAND_keep_random_devices_open(int keep);
Packit c4476c
Packit c4476c
Deprecated:
Packit c4476c
Packit c4476c
 #if OPENSSL_API_COMPAT < 0x10100000L
Packit c4476c
 int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam);
Packit c4476c
 void RAND_screen(void);
Packit c4476c
 #endif
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
These functions can be used to seed the random generator and to check its
Packit c4476c
seeded state.
Packit c4476c
In general, manual (re-)seeding of the default OpenSSL random generator
Packit c4476c
(L<RAND_OpenSSL(3)>) is not necessary (but allowed), since it does (re-)seed
Packit c4476c
itself automatically using trusted system entropy sources.
Packit c4476c
This holds unless the default RAND_METHOD has been replaced or OpenSSL was
Packit c4476c
built with automatic reseeding disabled, see L<RAND(7)> for more details.
Packit c4476c
Packit c4476c
RAND_status() indicates whether or not the random generator has been sufficiently
Packit c4476c
seeded. If not, functions such as L<RAND_bytes(3)> will fail.
Packit c4476c
Packit c4476c
RAND_poll() uses the system's capabilities to seed the random generator using
Packit c4476c
random input obtained from polling various trusted entropy sources.
Packit c4476c
The default choice of the entropy source can be modified at build time,
Packit c4476c
see L<RAND(7)> for more details.
Packit c4476c
Packit c4476c
RAND_add() mixes the B<num> bytes at B<buf> into the internal state
Packit c4476c
of the random generator.
Packit c4476c
This function will not normally be needed, as mentioned above.
Packit c4476c
The B<randomness> argument is an estimate of how much randomness is
Packit c4476c
contained in
Packit c4476c
B<buf>, in bytes, and should be a number between zero and B<num>.
Packit c4476c
Details about sources of randomness and how to estimate their randomness
Packit c4476c
can be found in the literature; for example [NIST SP 800-90B].
Packit c4476c
The content of B<buf> cannot be recovered from subsequent random generator output.
Packit c4476c
Applications that intend to save and restore random state in an external file
Packit c4476c
should consider using L<RAND_load_file(3)> instead.
Packit c4476c
Packit c4476c
RAND_seed() is equivalent to RAND_add() with B<randomness> set to B<num>.
Packit c4476c
Packit c4476c
RAND_keep_random_devices_open() is used to control file descriptor
Packit c4476c
usage by the random seed sources. Some seed sources maintain open file
Packit c4476c
descriptors by default, which allows such sources to operate in a
Packit c4476c
chroot(2) jail without the associated device nodes being available. When
Packit c4476c
the B<keep> argument is zero, this call disables the retention of file
Packit c4476c
descriptors. Conversely, a non-zero argument enables the retention of
Packit c4476c
file descriptors. This function is usually called during initialization
Packit c4476c
and it takes effect immediately.
Packit c4476c
Packit c4476c
RAND_event() and RAND_screen() are equivalent to RAND_poll() and exist
Packit c4476c
for compatibility reasons only. See HISTORY section below.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
RAND_status() returns 1 if the random generator has been seeded
Packit c4476c
with enough data, 0 otherwise.
Packit c4476c
Packit c4476c
RAND_poll() returns 1 if it generated seed data, 0 otherwise.
Packit c4476c
Packit c4476c
RAND_event() returns RAND_status().
Packit c4476c
Packit c4476c
The other functions do not return values.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<RAND_bytes(3)>,
Packit c4476c
L<RAND_egd(3)>,
Packit c4476c
L<RAND_load_file(3)>,
Packit c4476c
L<RAND(7)>
Packit c4476c
Packit c4476c
=head1 HISTORY
Packit c4476c
Packit c4476c
RAND_event() and RAND_screen() were deprecated in OpenSSL 1.1.0 and should
Packit c4476c
not be used.
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut