277 number_srcptr src3,
const bool isreduced,
const fp3_param param, uint8_t stack);
303 const bool isreduced,
const fp3_param param, uint8_t stack);
335 fp3_str (
char **str,
const fp3_param param,
const uint8_t base, uint8_t stack);
349 const bool lift,
const fp3_param param, uint8_t stack);
int8_t fp3_elt_ispower_number(fp3_elt_srcptr src, number_srcptr n, const fp3_param param, uint8_t stack)
Test if src is a n-power in FP3, using A NOTE ON POWERS IN FINITE FIELDS from ANDREAS AABRANDT AND VA...
void fp3_elt_set_one(fp3_elt_ptr dst, const fp3_param param)
Set dst to one (or its Montgomery form if Montgomery arithmetic is used)
int8_t fp3_elt_cmp_fp_elt(fp3_elt_srcptr src1, fp_elt_srcptr src2, const fp3_param param)
Compare src1 and src2 in FP3.
void fp3_elt_mul8(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param)
Set dst <- 8 * src.
bool fp3_elt_issquare(fp3_elt_srcptr src, const fp3_param param, uint8_t stack)
Test if src is a square, using A NOTE ON POWERS IN FINITE FIELDS from ANDREAS AABRANDT AND VAGN LUNDS...
void fp3_elt_get_pool_elt(fp3_elt *dst, const fp3_param param, uint8_t stack)
Allocate and initialise space for a temporary cubic extension field element.
void fp3_alloc(fp3_param param, const fp_param base)
Allocate space for the cubic extension field informations structure.
void fp3_elt_clear(fp3_elt *src)
Clear space used by src (remove the action of fp3_elt_init but let the one of fp3_elt_alloc)
void fp3_elt_set(fp3_elt_ptr dst, number_srcptr src1, number_srcptr src2, number_srcptr src3, const bool isreduced, const fp3_param param, uint8_t stack)
Set dst to src1 + src2*x + src3*x^2, if Montgomery arithmetic is used, is_reduced == false -> transfo...
void fp3_elt_set_fp_elt(fp3_elt_ptr dst, fp_elt_srcptr src, const fp3_param param)
Set dst to src.
void fp3_str(char **str, const fp3_param param, const uint8_t base, uint8_t stack)
Converts fp2_param param to string format in base specified by base.
void fp3_elt_add_fp_elt(fp3_elt_ptr dst, fp3_elt_srcptr src1, fp_elt_srcptr src2, const fp3_param param)
Set dst <- src1 + src2.
void fp3_elt_mul2(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param)
Set dst <- 2 * src.
void fp3_elt_lift(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param, uint8_t stack)
If Montgomery arithmetic is used, lift src (which is into Montgomery form) to classical FP3.
void fp3_elt_set_number(fp3_elt_ptr dst, number_srcptr src, const bool isreduced, const fp3_param param, uint8_t stack)
Set dst to src, if Montgomery arithmetic is used, is_reduced == false -> transform dst into its Montg...
void fp3_elt_neg_fp_elt(fp3_elt_ptr dst, fp_elt_srcptr src, const fp3_param param)
Set dst <- (-src)
const fp3_elt_t * fp3_elt_srcptr
Define fp3_elt_srcptr, use in all functions where the parameter is const.
void fp3_elt_free(fp3_elt *src)
Free space used by src.
void fp3_elt_pow_ui(fp3_elt_ptr dst, fp3_elt_srcptr src, const block n, const fp3_param param, uint8_t stack)
Set dst <- src^n.
void fp3_get_size(number_ptr c, const fp3_param param)
Get the size of the cubic extension field "param".
void fp3_elt_sqrt(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param, uint8_t stack)
Set dst <- src^(1/2), using Tonelli–Shanks algorithm.
bool fp3_elt_isone(fp3_elt_srcptr src, const fp3_param param)
Test if src is one.
void fp3_elt_set_zero(fp3_elt_ptr dst, const fp3_param param)
Set dst to zero.
void fp3_elt_set_str(fp3_elt_ptr dst, const char *str, const uint8_t base, const bool isreduced, const fp3_param param, uint8_t stack)
Set dst to str, if Montgomery arithmetic is used, is_reduced == false -> transform dst into its Montg...
void fp3_elt_sqr_fp_elt(fp3_elt_ptr dst, fp_elt_srcptr src, const fp3_param param, uint8_t stack)
Set dst <- src^2.
fp3_elt_t * fp3_elt_ptr
Define fp3_elt_ptr, use in all functions.
void fp3_elt_init(fp3_elt_ptr dst, const fp3_param param)
Initialise a cubic extension field element.
void fp3_elt_neg(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param)
Set dst <- (-src)
void fp3_elt_inc(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param)
Set dst <- src + 1.
void fp3_elt_random(fp3_elt_ptr dst, const fp3_param param, uint8_t stack)
Set dst to a random element of FP3, the random process is chosen at the MHELL initialisation.
void fp3_elt_mul4(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param)
Set dst <- 4 * src.
fp3_param_t * fp3_param
Address of a cubic extension field structure.
void fp3_elt_dec(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param)
Set dst <- src - 1.
void fp3_elt_sub_fp_elt(fp3_elt_ptr dst, fp3_elt_srcptr src1, fp_elt_srcptr src2, const fp3_param param)
Set dst <- src1 - src2.
void fp3_elt_set_fp_elts(fp3_elt_ptr dst, fp_elt_srcptr src1, fp_elt_srcptr src2, fp_elt_srcptr src3, const fp3_param param)
Set dst to src1 + src2*x + src3*x^2.
void fp3_elt_mul_fp_elt(fp3_elt_ptr dst, fp3_elt_srcptr src1, fp_elt_srcptr src2, const fp3_param param, uint8_t stack)
Set dst <- src1 * src2, if Montgomery arithmetic is used, the Montgomery multiplication will be used ...
void fp3_elt_pow_number(fp3_elt_ptr dst, fp3_elt_srcptr src, number_srcptr n, const fp3_param param, uint8_t stack)
Set dst <- src^n.
void fp3_copy(fp3_param param_res, const fp3_param param)
Copy the cubic extension field structure param into param_res.
void fp3_elt_copy(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param)
Copy src into dst, src and dst must belong to the same FP3.
void fp3_elt_unity_nth_root(fp3_elt_ptr dst, const block n, const fp3_param param, uint8_t stack)
Set dst to a non trivial n-th root of unity if it exists (ie n divides q-1), 1 otherwise.
void fp3_free(fp3_param param)
Free the space of the cubic extension field informations structure.
void fp3_elt_relax_pool_elt(fp3_elt *dst, const fp3_param param, uint8_t stack)
Free space of a temporary cubic extension field element.
void fp3_elt_div(fp3_elt_ptr dst, fp3_elt_srcptr src1, fp3_elt_srcptr src2, const fp3_param param, uint8_t stack)
Set dst <- src1 / src2.
void fp3_elt_alloc(fp3_elt *dst, const fp3_param param)
Allocate space for a cubic extension field element.
void fp3_elt_str(char **str, fp3_elt_srcptr src, const uint8_t base, const bool lift, const fp3_param param, uint8_t stack)
Converts src to string format in base specified by base.
fp3_elt_t fp3_elt
Cubic extension field element structure.
void fp3_elt_cube_root(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param, uint8_t stack)
Set dst <- src^(1/3)
void fp3_elt_div_fp_elt(fp3_elt_ptr dst, fp3_elt_srcptr src1, fp_elt_srcptr src2, const fp3_param param, uint8_t stack)
Set dst <- src1 / src2.
void fp3_elt_mul(fp3_elt_ptr dst, fp3_elt_srcptr src1, fp3_elt_srcptr src2, const fp3_param param, uint8_t stack)
Set dst <- src1 * src2, if Montgomery arithmetic is used, the Montgomery multiplication will be used ...
void fp3_elt_add(fp3_elt_ptr dst, fp3_elt_srcptr src1, fp3_elt_srcptr src2, const fp3_param param)
Set dst <- src1 + src2.
int8_t fp3_elt_ispower_ui(fp3_elt_srcptr src, const block n, const fp3_param param, uint8_t stack)
Test if src is a n-power in FP3, using A NOTE ON POWERS IN FINITE FIELDS from ANDREAS AABRANDT AND VA...
void fp3_elt_sqr(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param, uint8_t stack)
Set dst <- src^2.
void fp3_elt_mul3(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param, uint8_t stack)
Set dst <- 3 * src.
void fp3_elt_inv(fp3_elt_ptr dst, fp3_elt_srcptr src, const fp3_param param, uint8_t stack)
Set dst <- src^(-1)
void fp3_create(fp3_param param, const fp_param base, fp_elt_srcptr non_residue, uint8_t stack)
Create a cubic extension of the field base.
bool fp3_elt_iszero(fp3_elt_srcptr src, const fp3_param param)
Test if src is zero.
void fp3_get_characteristic(number_ptr c, const fp3_param param)
Get the characteristic of the cubic extension field "param".
void fp3_elt_set_ui(fp3_elt_ptr dst, const uint64_t src, const bool isreduced, const fp3_param param, uint8_t stack)
Set dst to src, if Montgomery arithmetic is used, is_reduced == false -> transform dst into its Montg...
void fp3_elt_inv_fp_elt(fp3_elt_ptr dst, fp_elt_srcptr src, const fp3_param param, uint8_t stack)
Set dst <- src^(-1)
void fp3_elt_sub(fp3_elt_ptr dst, fp3_elt_srcptr src1, fp3_elt_srcptr src2, const fp3_param param)
Set dst <- src1 - src2.
int8_t fp3_elt_cmp(fp3_elt_srcptr src1, fp3_elt_srcptr src2, const fp3_param param)
Compare src1 and src2 in FP3.
Declaration of primary field functions, if Montgomery arithmetic is used, the Montgomery arithmetic w...
Cubic extension field element structure.
Cubic extension field structure.
Primary field parameters.