don't read so much from /dev/random as it's slow
authorRudolf Polzer <divverent@alientrap.org>
Sat, 24 Apr 2010 19:58:11 +0000 (21:58 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 24 Apr 2010 19:58:11 +0000 (21:58 +0200)
d0_bignum-gmp.c

index 87aa0b8..a66096d 100644 (file)
@@ -41,6 +41,7 @@ void d0_bignum_INITIALIZE()
        if(f)
        {
                unsigned char buf[256];
+               setbuf(f, NULL);
                if(fread(buf, sizeof(buf), 1, f) == 1)
                {
                        mpz_import(temp.z, sizeof(buf), 1, 1, 0, 0, buf);