diff --git a/code_producers/src/c_elements/grumpkin/fr.cpp b/code_producers/src/c_elements/grumpkin/fr.cpp index 39f5257d4..14864de1c 100644 --- a/code_producers/src/c_elements/grumpkin/fr.cpp +++ b/code_producers/src/c_elements/grumpkin/fr.cpp @@ -53,9 +53,9 @@ bool Fr_init() { return true; } -void Fr_str2element(PFrElement pE, char const *s) { +void Fr_str2element(PFrElement pE, char const *s, uint base) { mpz_t mr; - mpz_init_set_str(mr, s, 10); + mpz_init_set_str(mr, s, base); mpz_fdiv_r(mr, mr, q); Fr_fromMpz(pE, mr); mpz_clear(mr); diff --git a/code_producers/src/c_elements/grumpkin/fr.hpp b/code_producers/src/c_elements/grumpkin/fr.hpp index 52bbdae4e..643fc3f71 100644 --- a/code_producers/src/c_elements/grumpkin/fr.hpp +++ b/code_producers/src/c_elements/grumpkin/fr.hpp @@ -68,7 +68,7 @@ extern "C" void Fr_fail(); // Pending functions to convert -void Fr_str2element(PFrElement pE, char const*s); +void Fr_str2element(PFrElement pE, char const*s, uint base); char *Fr_element2str(PFrElement pE); void Fr_idiv(PFrElement r, PFrElement a, PFrElement b); void Fr_mod(PFrElement r, PFrElement a, PFrElement b); diff --git a/code_producers/src/c_elements/pallas/fr.cpp b/code_producers/src/c_elements/pallas/fr.cpp index 39f5257d4..14864de1c 100644 --- a/code_producers/src/c_elements/pallas/fr.cpp +++ b/code_producers/src/c_elements/pallas/fr.cpp @@ -53,9 +53,9 @@ bool Fr_init() { return true; } -void Fr_str2element(PFrElement pE, char const *s) { +void Fr_str2element(PFrElement pE, char const *s, uint base) { mpz_t mr; - mpz_init_set_str(mr, s, 10); + mpz_init_set_str(mr, s, base); mpz_fdiv_r(mr, mr, q); Fr_fromMpz(pE, mr); mpz_clear(mr); diff --git a/code_producers/src/c_elements/pallas/fr.hpp b/code_producers/src/c_elements/pallas/fr.hpp index 96178f86d..cdc3603c0 100644 --- a/code_producers/src/c_elements/pallas/fr.hpp +++ b/code_producers/src/c_elements/pallas/fr.hpp @@ -68,7 +68,7 @@ extern "C" void Fr_fail(); // Pending functions to convert -void Fr_str2element(PFrElement pE, char const*s); +void Fr_str2element(PFrElement pE, char const*s, uint base); char *Fr_element2str(PFrElement pE); void Fr_idiv(PFrElement r, PFrElement a, PFrElement b); void Fr_mod(PFrElement r, PFrElement a, PFrElement b); diff --git a/code_producers/src/c_elements/vesta/fr.cpp b/code_producers/src/c_elements/vesta/fr.cpp index 39f5257d4..14864de1c 100644 --- a/code_producers/src/c_elements/vesta/fr.cpp +++ b/code_producers/src/c_elements/vesta/fr.cpp @@ -53,9 +53,9 @@ bool Fr_init() { return true; } -void Fr_str2element(PFrElement pE, char const *s) { +void Fr_str2element(PFrElement pE, char const *s, uint base) { mpz_t mr; - mpz_init_set_str(mr, s, 10); + mpz_init_set_str(mr, s, base); mpz_fdiv_r(mr, mr, q); Fr_fromMpz(pE, mr); mpz_clear(mr); diff --git a/code_producers/src/c_elements/vesta/fr.hpp b/code_producers/src/c_elements/vesta/fr.hpp index 96178f86d..cdc3603c0 100644 --- a/code_producers/src/c_elements/vesta/fr.hpp +++ b/code_producers/src/c_elements/vesta/fr.hpp @@ -68,7 +68,7 @@ extern "C" void Fr_fail(); // Pending functions to convert -void Fr_str2element(PFrElement pE, char const*s); +void Fr_str2element(PFrElement pE, char const*s, uint base); char *Fr_element2str(PFrElement pE); void Fr_idiv(PFrElement r, PFrElement a, PFrElement b); void Fr_mod(PFrElement r, PFrElement a, PFrElement b);