Small limb-size in mini-gmp?

Niels Möller nisse at
Sun Nov 10 08:43:10 UTC 2019


I noticed the recent change, "mini-gmp: Avoid undefined
behaviour with small limb sizes."

Currently, mini-gmp.h makes mp_limb_t an alias for unsigned long, which
by the C spec ought to be at least 32 bits. And then, e.g.,

  int LOCAL_SHIFT_BITS = 16;
  if (sizeof(mp_limb_t) * CHAR_BIT > LOCAL_SHIFT_BITS)

ought to be always true. Are you planning to do something like
artificial-small-limbs for mini-gmp, suggested on the list a while ago?



should be equivalent, and slightly more readable, imo.


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

More information about the gmp-devel mailing list