#include
int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
int BN_rand_range(BIGNUM *rnd, BIGNUM *range);
int BN_pseudo_rand_range(BIGNUM *rnd, BIGNUM *range);
_B_N___p_s_e_u_d_o___r_a_n_d_(_) does the same, but pseudo-random numbers generated by this function are not necessarily unpredictable. They can be used for non-cryptographic purposes and for certain purposes in cryptographic protocols, but usually not for key generation etc.
_B_N___r_a_n_d___r_a_n_g_e_(_) generates a cryptographically strong pseudo-random
number rrnndd in the range 0
The PRNG must be seeded prior to calling _B_N___r_a_n_d_(_) or _B_N___r_a_n_d___r_a_n_g_e_(_).
RETURN VALUES
The functions return 1 on success, 0 on error.
The error codes can be obtained by _E_R_R___g_e_t___e_r_r_o_r(3).
SEE ALSO
_o_p_e_n_s_s_l___b_n(3), _E_R_R___g_e_t___e_r_r_o_r(3), _o_p_e_n_s_s_l___r_a_n_d(3),
_R_A_N_D___a_d_d(3), _R_A_N_D___b_y_t_e_s(3)
HISTORY
_B_N___r_a_n_d_(_) is available in all versions of SSLeay and OpenSSL.
_B_N___p_s_e_u_d_o___r_a_n_d_(_) was added in OpenSSL 0.9.5. The ttoopp == -1 case
and the function _B_N___r_a_n_d___r_a_n_g_e_(_) were added in OpenSSL 0.9.6a.
_B_N___p_s_e_u_d_o___r_a_n_d___r_a_n_g_e_(_) was added in OpenSSL 0.9.6c.