You don't need to call RAND_write_file. RAND_load_file("/dev/random",bytes ) will seed the PRNG with whatever is the value of "bytes" variable.
-Sandeep On Sun, Sep 19, 2010 at 3:59 AM, krishnamurthy santhanam < krishnamurth...@gmail.com> wrote: > Hi, > > > I need to seed PRNG of 128 bytes. in the below program is seeding 1024 > byte. > > > is it possible seed 128 bytes of data using RAND_seed(). Any example should > be helpful for me. > > #include<string.h> > > #include<openssl/rand.h> > > #include<openssl/bn.h> > > > > > main() > > { > > /*int nb,l; > > l=RAND_load_file("/dev/random",bytes ); > > printf("Seeded the PRNG with %d byte(s) of data from prngseed.dat.\n",l); > > RAND_write_file("prngseed.dat"); > > nb=RAND_load_file("prngseed.dat", -1); > > printf("Seeded the PRNG with %d byte(s) of data from prngseed.dat.\n",nb); > > */ > > > } > > Thanks for your time, > Krishnamurthy >