Random number generation

Gabriele Martino martino.gabriele at fastwebnet.it
Thu Nov 3 10:33:57 CET 2005


Hi,
I need to generate random numbers of 512 bits.
I use the following code :

mpz_t p;
gmp_randstate_t rstate;
mpz_init2(p,512);
gmp_randinit(rstate,GMP_RAND_ALG_LC, 32);
mpz_urandomb(p, rstate, 512); 

The numbers are generated but the problem is that if I run several times this code it produces the SAME sequence of random numbers. 
How can I solve this problem? 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20051103/7da4bbf7/attachment.html


More information about the gmp-discuss mailing list