diff options
-rw-r--r-- | randlc.c | 1 | ||||
-rw-r--r-- | randlc2x.c | 2 |
2 files changed, 3 insertions, 0 deletions
@@ -39,6 +39,7 @@ gmp_rand_init_lc (s, a, c, m) #endif { mpz_init_set_ui (s->seed, 1); + _mpz_realloc (s->seed, ABSIZ (m)); /* Allocate algorithm specific data. */ s->data.lc = (__gmp_rand_data_lc *) diff --git a/randlc2x.c b/randlc2x.c index 3999d406b..48273fc41 100644 --- a/randlc2x.c +++ b/randlc2x.c @@ -39,6 +39,8 @@ gmp_rand_init_lc_2exp (s, a, c, m2exp) #endif { mpz_init_set_ui (s->seed, 1); + _mpz_realloc (s->seed, m2exp / BITS_PER_MP_LIMB + + (m2exp % BITS_PER_MP_LIMB != 0)); /* Allocate algorithm specific data. */ s->data.lc = (__gmp_rand_data_lc *) |