Arguably, we should have a low-level mpn_get_str and mpn_set_str that utilizes the Fredrik's algorithms in fmpz_get_str and fmpz_set_str.
Preferably, this one should be declared on the formats
mp_size_t mpn_set_str(mp_ptr rp, const char * ip, size_t strlen, int base);
size_t mpn_get_str(char * rp, mp_srcptr up, mp_size_t un, int base);
and should assume that the input is correct. For high-level functions, mpn_set_str could be coupled with some very simple function that verifies that const char * ip is on the right format.
Arguably, we should have a low-level
mpn_get_str
andmpn_set_str
that utilizes the Fredrik's algorithms infmpz_get_str
andfmpz_set_str
.Preferably, this one should be declared on the formats
and should assume that the input is correct. For high-level functions,
mpn_set_str
could be coupled with some very simple function that verifies thatconst char * ip
is on the right format.