26 #ifndef MPHELL_EDWARDS_H 27 #define MPHELL_EDWARDS_H 123 const bool is_reduced,
const uint8_t base,
field_srcptr k, uint8_t stack);
void edwards_point_set_aff(ec_point_ptr P, fe_srcptr x, fe_srcptr y, field_srcptr k, uint8_t stack)
Set dest to the extended twisted Edwards coordinates point (x,y,1,xy)
bool edwards_point_are_equal(ec_point_srcptr P1, ec_point_srcptr P2, ec_curve_srcptr E, uint8_t stack)
Test if P1 and P2 are equal on E (BUT do not test if the points belongs to the curve )
fp_elt * field_elt
Generic field element.
void edwards_point_neg(ec_point_ptr P3, ec_point_srcptr P1, ec_curve_srcptr E)
Compute the opposite of a point of the the Edwards elliptic curve E.
void edwards_point_get_y_affine(field_elt y, ec_point_ptr P, ec_curve_srcptr E, uint8_t stack)
Convert P->y to its affine representation.
void edwards_curve_random_generation(fe_ptr d, char *seed_res, field_srcptr k, uint8_t stack)
Generate a 160 bits seed and coefficients a and b defining a Weiestrass elliptic curve....
void edwards_compute_disc(ec_curve E, uint8_t stack)
Set the discriminant of E: disc = a.d.(a-d)^4.
Define an elliptic curve point.
void edwards_point_set_neutral(ec_point_ptr dst, ec_curve_srcptr E, uint8_t stack)
Set dst to the neutral element: (0,1,0,1) for extended twisted Edwards coordinates.
void edwards_point_dbl_dedicated(ec_point_ptr P3, ec_point_srcptr P1, ec_curve_srcptr E, uint8_t stack)
Compute the double of a point of the Edwards elliptic curve E (not protected against SPA,...
bool edwards_verify_random_generation(ec_curve E, const char *seed, uint8_t stack)
Test if E if generated from the seed "seed".
void edwards_point_add_unified(ec_point_ptr P3, ec_point_srcptr P1, ec_point_srcptr P2, ec_curve_srcptr E, uint8_t stack)
Compute the unified addition of 2 points P1 and P2 of the Edwards elliptic curve E,...
bool edwards_belongs(ec_point_srcptr P, ec_curve_srcptr E, uint8_t stack)
Test if P belongs to E.
void edwards_point_norm(ec_point_ptr P, ec_curve_srcptr E, uint8_t stack)
Set P in affine coordinates.
void edwards_point_get_x_affine(field_elt x, ec_point_ptr P, ec_curve_srcptr E, uint8_t stack)
Convert P->x to its affine representation.
void edwards_point_random(ec_point_ptr P, ec_curve_srcptr E, uint8_t stack)
Set P to a random point on E.
const fp_elt * fe_srcptr
Pointer on a field element, the field element cannot be modified through this pointer.
void edwards_point_set_aff_str(ec_point_ptr P, const char *str_x, const char *str_y, const bool is_reduced, const uint8_t base, field_srcptr k, uint8_t stack)
Set dest to the affine point twisted Edwards coordinates point (str_x,str_y,1,str_x str_y)
fp_elt * fe_ptr
Pointer on a field element.
Define an elliptic curve.
void edwards_point_add_dedicated(ec_point_ptr P3, ec_point_srcptr P1, ec_point_srcptr P2, ec_curve_srcptr E, uint8_t stack)
Compute the addition of 2 points P1 and P2 of the Edwards elliptic curve E (not protected against SPA...
bool edwards_point_is_neutral(ec_point_srcptr P, ec_curve_srcptr E)
Test if P is the neutral element.