RAND_add,
RAND_seed
RAND_status
add entropy to the PRNG
libcrypto.lib
#include <openssl/rand.h>
void RAND_seed(const void *buf, int num);
void RAND_add(const void *buf, int num, double entropy);
int RAND_status(void);
RAND_add()
mixes the num bytes at buf into the PRNG state. Thus,
if the data at buf are unpredictable to an adversary, this
increases the uncertainty about the state and makes the PRNG output
less predictable. Suitable input comes from user interaction (random
key presses, mouse movements) and certain hardware events. The
entropy argument is (the lower bound of) an estimate of how much
randomness is contained in buf, measured in bytes. Details about
sources of randomness and how to estimate their entropy can be found
in the literature, e.g. RFC 1750.
RAND_add()
may be called with sensitive data such as user entered
passwords. The seed values cannot be recovered from the PRNG output.
OpenSSL makes sure that the PRNG state is unique for each thread. The application is responsible for seeding the PRNG by calling RAND_add() or RAND_load_file().
RAND_seed()
is equivalent to
RAND_add()
when num == entropy.
The functions do not return values.
rand(), RAND_load_file(), RAND_egd(), RAND_cleanup()
RAND_seed()
and
is available in all versions of SSLeay
and OpenSSL.
RAND_add()
and
RAND_status()
have been added in OpenSSL
0.9.5.
For additional information or queries on this page send feedback
© 2005-2007 Nokia |