From skir at sagemath.org Sat Dec 27 04:24:09 2025 From: skir at sagemath.org (Sergey B Kirpichev) Date: Sat, 27 Dec 2025 04:24:09 +0100 Subject: Expose few private mpn_* functions? Message-ID: Hello, few basic integer functions are available only via mpz_*() interfaces, could you please consider to provide also mpn_*() analogs, which support arguments of mp_size_t size? 1) mpn_export/import() - mpz_export/import() already support only unsigned integers. I think similar API would be natural rather for mpn_* functions. 2) mpn_pow_1() - it's exposed as public (maybe it's not intentional), but not documented yet and has comments that this API is unstable. In particular, it has an argument for scratch space, missing in other functions. 3) mpn_powm() and other primitives, that make mpz_powm() possible. 4) mpn_get_d() - this is of least importance, but it's API looks stable and I don't see big reasons to hide it. I can provide patches for (1) and (4).