5 RAND_set_rand_method, RAND_get_rand_method, RAND_SSLeay - Select RAND method
9 #include <openssl/rand.h>
11 void RAND_set_rand_method(RAND_METHOD *meth);
13 RAND_METHOD *RAND_get_rand_method(void);
15 RAND_METHOD *RAND_SSLeay(void);
19 A B<RAND_METHOD> specifies the functions that OpenSSL uses for random
20 number generation. By modifying the method, alternative
21 implementations such as hardware RNGs may be used. Initially, the
22 default is to use the OpenSSL internal implementation. RAND_SSLeay()
23 returns a pointer to that method.
25 RAND_set_rand_method() sets the RAND method to B<meth>.
26 RAND_get_rand_method() returns a pointer to the current method.
28 =head1 THE RAND_METHOD STUCTURE
30 typedef struct rand_meth_st
32 void (*seed)(const void *buf, int num);
33 int (*bytes)(unsigned char *buf, int num);
34 void (*cleanup)(void);
35 void (*add)(const void *buf, int num, int entropy);
36 int (*pseudorand)(unsigned char *buf, int num);
39 The components point to the implementation of RAND_seed(),
40 RAND_bytes(), RAND_cleanup(), RAND_add() and RAND_pseudo_rand().
41 Each component may be NULL if the function is not implemented.
45 RAND_set_rand_method() returns no value. RAND_get_rand_method() and
46 RAND_SSLeay() return pointers to the respective methods.
54 RAND_set_rand_method(), RAND_get_rand_method() and RAND_SSLeay() are
55 available in all versions of OpenSSL.