+2013-01-31 Niels Möller <nisse@lysator.liu.se>
+
+ * bignum-random.c (nettle_mpz_random): Increased number of extra
+ bits to 64, following FIPS 186-3.
+
2013-01-12 Niels Möller <nisse@lysator.liu.se>
* configure.ac: Use AC_LANG_SOURCE.
*/
/* Add a few bits extra, to decrease the bias from the final modulo
- * operation. */
+ * operation. NIST FIPS 186-3 specifies 64 extra bits, for use with
+ * DSA. */
nettle_mpz_random_size(x,
ctx, random,
- mpz_sizeinbase(n, 2) + 16);
+ mpz_sizeinbase(n, 2) + 64);
mpz_fdiv_r(x, x, n);
}