wrap-around interface

Niels Möller nisse at lysator.liu.se
Thu Oct 18 10:43:34 CEST 2012

Zimmermann Paul <Paul.Zimmermann at loria.fr> writes:

> void mpn_mulmod_bnm1 (mp_ptr rp, mp_size_t rn, mp_srcptr ap, mp_size_t an,
>                       mp_srcptr, bp, mp_size_t bn, mp_ptr tp)
> Multiplies {ap, an} by {bp, bn} mod B^rn-1 where B=2^mp_bits_per_limb,
> and stores the result into {rp, rn}. The scratch space tp is either NULL,
> in which case the function allocates itself the needed memory, or it should
> contain at least 2*rn+4 limbs (or the number of needed limbs should be
> documented).

To find out the needed scratch space, you should use
mpn_mulmod_bnm1_itch. Scratch need is going to change if/when the fft
code (or general multiplication) is converted to an itch/scratch

If we make this interface public, should we advertise itch/scratch, or
should we keep that detail internal, and require applications to always
pass tp == NULL?


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

More information about the gmp-devel mailing list