Commit 5172adc3 authored by Niels Möller's avatar Niels Möller

nettle_mpz_random: Increased number of extra bits to 64, following FIPS 186-3.

parent a6671dc5
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.
......
......@@ -75,11 +75,12 @@ nettle_mpz_random(mpz_t x,
*/
/* 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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment