Problem with gmp_randinit_set

Pedro Gimeno gmpdiscuss at formauri.es
Sat Feb 18 12:47:33 UTC 2017


Niels Möller wrote, On 2017-02-18 08:24:

> Does the current seeding conform to some informal standard?

Not that I know.

> Do we want
> to generate same sequences as other mersenne twister implementations, or
> is it only an issue of whether or not we want to change seeding and
> generate different sequences than earlier GMP versions?

The latter.

There are two problems with the standard MT seeding routines. One is that the sequences generated with consecutive seeds are too correlated. The other is that they don't give any guarantees of uniqueness for a range of seeds that I am aware of. I might be missing something, though.

> I think we can use even smaller limbs for testing purposes, with
> mp_limb_t defined as some magic C++ type.

If there's a point to that, I guess it's possible to use char, or even short with nails. I just can't see it right away. The GNU coding standards recommend forgetting about supporting CPUs with less than 32 bits [1].

> It's a bit tricky to use gmp and mini-gmp in the same program, they're
> not binary compatible. But to use a general exponentiation routine,
> mpn_powm is available.

Fair enough.

[1] https://www.gnu.org/prep/standards/html_node/CPU-Portability.html



More information about the gmp-bugs mailing list