FLINT3.7.0-dev

mpn_ctx_struct, mpn_ctx_t

Synopsis#include <flint/fft_small.h>
mpn_ctx_struct
mpn_ctx_t

A multiplication context. It holds the transform contexts of MPN_CTX_NCRTS = 8 primes, the Chinese remaindering data for the first k of them for every k \le 8, tables of powers of two modulo each prime for converting integers, the table of packing profiles, the constants of the two-prime pipeline, and a scratch buffer that grows on demand and is kept between calls.

The primes are generated from the initial prime given to mpn_ctx_init. FLINT always uses p_0 = 63 \cdot 2^{44} + 1, which yields

ip_iform
0110830772079820963 \cdot 2^{44} + 1
165970697666560175 \cdot 2^{43} + 1
21086317488242689247 \cdot 2^{42} + 1
3910395627798529207 \cdot 2^{42} + 1
4699289395265537159 \cdot 2^{42} + 1
51022545813831681465 \cdot 2^{41} + 1
61013749720809473461 \cdot 2^{41} + 1
7868614185943041395 \cdot 2^{41} + 1

All have 50 bits. A transform of length 2^d modulo the first k primes needs 2^d \mid p_i - 1 for each of them, so d \le 41 in general and d \le 43 for the two-prime pipeline: far beyond any realistic size. The fields are described with the low-level functions in Chinese remaindering and integer conversion.

Guides#

Cite this page

The FLINT team, “mpn_ctx_struct, mpn_ctx_t (fft_small.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fft_small/mpn_ctx_struct.html (generated 2026-10-20).