Problem with gmp_randinit_set

Niels Möller nisse at
Fri Feb 17 19:01:30 UTC 2017

nisse at (Niels Möller) writes:

> It shouldn't be too hard to rewrite randseed_mt to use mpn_powm, right?
> Which probably didn't exist when the original version was written. 

Or if we want to take advantage of the structure, we need an mpn
function to reduce numbers modulo 2^19937 - 20023. The input seed is of
arbitrary size, right?

How important is support for other limbsizes than 32 and 64 bits?
We'd need special code to support artificially small limbs, where 20023
doesn't fit in a limb. Perhaps it's good enough to have special code for
32 and 64 bits, and fall back to mpn_powm for other sizes. And then test
that all variants produce the same results.


Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.

More information about the gmp-bugs mailing list