use /dev/urandom
authorRudolf Polzer <divverent@alientrap.org>
Sun, 25 Apr 2010 14:26:10 +0000 (16:26 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 25 Apr 2010 14:26:10 +0000 (16:26 +0200)
d0_bignum-gmp.c

index 93bf0f7..2641449 100644 (file)
@@ -37,7 +37,9 @@ void d0_bignum_INITIALIZE(void)
        d0_bignum_init(&temp);
        gmp_randinit_mt(RANDSTATE);
        gmp_randseed_ui(RANDSTATE, time(NULL));
-       f = fopen("/dev/random", "rb");
+       f = fopen("/dev/urandom", "rb");
+       if(!f)
+               f = fopen("/dev/random", "rb");
        if(f)
        {
                unsigned char buf[256];