Problem with gmp_randinit_set

Torbjörn Granlund tg at
Tue Feb 14 23:45:45 UTC 2017

Pedro Gimeno <gmpdiscuss at> writes:

  Torbjörn Granlund wrote, On 2017-02-14 01:41:
  > One can change Mersenne_Twister_Generator_Noseed to
  > Mersenne_Twister_Generator to fix this (and move __gmp_randiset_mt to
  > randmts.c as mandated by Mersenne_Twister_Generator's scope), and then
  > your code supposedly runs without a crash.  But I don't see why one ever
  > wants Mersenne_Twister_Generator_Noseed, which suggests my understanding
  > of this code is very poor indeed.
  It's been about 15 years ago, but my recollection is that the rationale behind the _Noseed version was to avoid a dependency on randmts.c, and it seems I neglected to consider this use case.
  I agree with your fix.
I realised a serious flaw with that fix; it introduces a dependency from
mpn_random* to mpz.  That's not OK, I'm afraid.

Please encrypt, key id 0xC8601622

More information about the gmp-bugs mailing list