mpn_ctx_struct, mpn_ctx_t
#include <flint/fft_small.h>mpn_ctx_structmpn_ctx_tA 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
| i | p_i | form |
|---|---|---|
| 0 | 1108307720798209 | 63 \cdot 2^{44} + 1 |
| 1 | 659706976665601 | 75 \cdot 2^{43} + 1 |
| 2 | 1086317488242689 | 247 \cdot 2^{42} + 1 |
| 3 | 910395627798529 | 207 \cdot 2^{42} + 1 |
| 4 | 699289395265537 | 159 \cdot 2^{42} + 1 |
| 5 | 1022545813831681 | 465 \cdot 2^{41} + 1 |
| 6 | 1013749720809473 | 461 \cdot 2^{41} + 1 |
| 7 | 868614185943041 | 395 \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#
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).
@misc{flint-doc-fft-small-mpn-ctx-struct,
author = {{The FLINT team}},
title = {{mpn\_ctx\_struct, mpn\_ctx\_t (fft\_small.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fft_small/mpn_ctx_struct.html},
note = {Generated 2026-10-20}
}