MPHELL
5.0.0
|
Declaration of Jacobi ECC functions. More...
Go to the source code of this file.
Functions | |
void | jacobi_quartic_compute_disc (ec_curve E, uint8_t stack) |
Set the discriminant of E: disc = (2^8).(a^2 - 1)^2. More... | |
bool | jacobi_quartic_verify_random_generation (ec_curve E, const char *seed, uint8_t stack) |
Test if E if generated from the seed "seed". More... | |
void | jacobi_quartic_curve_random_generation (fe_ptr a, char *seed_res, field_srcptr k, uint8_t stack) |
Generate a 160 bits seed and coefficients a and b defining a Weiestrass elliptic curve. The curve is not tested to be secure !!! More... | |
void | jacobi_quartic_point_set_neutral (ec_point_ptr dst, ec_curve_srcptr E, uint8_t stack) |
Set dst to the neutral element: (0,1,0,1). More... | |
void | jacobi_quartic_point_set_aff (ec_point_ptr P, fe_srcptr x, fe_srcptr y, field_srcptr k, uint8_t stack) |
Set dest to the affine point (x,y) More... | |
void | jacobi_quartic_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 (str_x,str_y) More... | |
bool | jacobi_quartic_belongs (ec_point_srcptr P, ec_curve_srcptr E, uint8_t stack) |
Test if P belongs to E. More... | |
void | jacobi_quartic_point_random (ec_point_ptr P, ec_curve_srcptr E, uint8_t stack) |
Create a random point P on the elliptic curve E. More... | |
void | jacobi_quartic_point_norm (ec_point_ptr P, ec_curve_srcptr E, uint8_t stack) |
Convert a point in extented projective coordinate (X,Y,T,Z) to an affine point (x,y) with x=X/Z, y=Y/Z. More... | |
void | jacobi_quartic_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. More... | |
void | jacobi_quartic_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. More... | |
bool | jacobi_quartic_point_is_neutral (ec_point_srcptr P, ec_curve_srcptr E) |
Test if P is the neutral element. More... | |
bool | jacobi_quartic_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. More... | |
void | jacobi_quartic_point_neg (ec_point_ptr P3, ec_point_srcptr P1, ec_curve_srcptr E) |
Set P3 to -P1. More... | |
void | jacobi_quartic_point_add_unified (ec_point_ptr P3, ec_point_srcptr P1, ec_point_srcptr P2, ec_curve_srcptr E, uint8_t stack) |
Set P3 to P1 + P2 using extended projective coordinate (T=(X^2)/Z), and unified formulae (protection against SPA) More... | |
void | jacobi_quartic_point_add_raw (ec_point_ptr P3, ec_point_srcptr P1, ec_point_srcptr P2, ec_curve_srcptr E, uint8_t stack) |
Set P3 to P1 + P2 using extended projective coordinate (T=(X^2)/Z), and unified formulae (protection against SPA). Tests of infinity and equality are not done ! More... | |
void | jacobi_quartic_point_dbl_dedicated (ec_point_ptr P3, ec_point_srcptr P1, ec_curve_srcptr E, uint8_t stack) |
Set P3 to 2*P1, using dedicated formulae (not protected against SPA, but faster) More... | |
Declaration of Jacobi ECC functions.
Definition in file mphell-jacobi.h.
bool jacobi_quartic_belongs | ( | ec_point_srcptr | P, |
ec_curve_srcptr | E, | ||
uint8_t | stack | ||
) |
Test if P belongs to E.
P | Jacobi quartic point |
E | Elliptic curve |
stack | Temporary memory stack to use |
Definition at line 352 of file mphell-jacobi.c.
void jacobi_quartic_compute_disc | ( | ec_curve | E, |
uint8_t | stack | ||
) |
Set the discriminant of E: disc = (2^8).(a^2 - 1)^2.
E | Elliptic curve |
stack | Temporary memory stack to use |
Definition at line 32 of file mphell-jacobi.c.
void jacobi_quartic_curve_random_generation | ( | fe_ptr | a, |
char * | seed_res, | ||
field_srcptr | k, | ||
uint8_t | stack | ||
) |
Generate a 160 bits seed and coefficients a and b defining a Weiestrass elliptic curve. The curve is not tested to be secure !!!
a | Destination coefficient, generated from a random seed |
seed_res | Destination seed (of 160 bits) used to generate an elliptic curve |
k | Base field, must be created by the user before use. |
stack | Temporary memory stack to use |
Definition at line 172 of file mphell-jacobi.c.
void jacobi_quartic_point_add_raw | ( | ec_point_ptr | P3, |
ec_point_srcptr | P1, | ||
ec_point_srcptr | P2, | ||
ec_curve_srcptr | E, | ||
uint8_t | stack | ||
) |
Set P3 to P1 + P2 using extended projective coordinate (T=(X^2)/Z), and unified formulae (protection against SPA). Tests of infinity and equality are not done !
P3 | Resulting point |
P1 | Source point |
P2 | Source point |
E | Elliptic curve |
stack | Temporary memory stack to use |
Definition at line 654 of file mphell-jacobi.c.
void jacobi_quartic_point_add_unified | ( | ec_point_ptr | P3, |
ec_point_srcptr | P1, | ||
ec_point_srcptr | P2, | ||
ec_curve_srcptr | E, | ||
uint8_t | stack | ||
) |
Set P3 to P1 + P2 using extended projective coordinate (T=(X^2)/Z), and unified formulae (protection against SPA)
P3 | Resulting point |
P1 | Source point |
P2 | Source point |
E | Elliptic curve |
stack | Temporary memory stack to use |
Definition at line 565 of file mphell-jacobi.c.
bool jacobi_quartic_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.
P1 | Point |
P2 | Point |
E | Elliptic curve |
stack | Temporary memory stack to use |
Definition at line 488 of file mphell-jacobi.c.
void jacobi_quartic_point_dbl_dedicated | ( | ec_point_ptr | P3, |
ec_point_srcptr | P1, | ||
ec_curve_srcptr | E, | ||
uint8_t | stack | ||
) |
Set P3 to 2*P1, using dedicated formulae (not protected against SPA, but faster)
P3 | Resulting point |
P1 | Source point |
E | Elliptic curve (Jacobi quartic) |
stack | Temporary memory stack to use |
Definition at line 737 of file mphell-jacobi.c.
void jacobi_quartic_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.
x | P->x in affine coordinates |
P | Point |
E | Elliptic curve |
stack | Temporary memory stack to use |
Definition at line 452 of file mphell-jacobi.c.
void jacobi_quartic_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.
x | P->y in affine coordinates |
P | Point |
E | Elliptic curve |
stack | Temporary memory stack to use |
Definition at line 465 of file mphell-jacobi.c.
bool jacobi_quartic_point_is_neutral | ( | ec_point_srcptr | P, |
ec_curve_srcptr | E | ||
) |
Test if P is the neutral element.
P | Point to test |
E | Elliptic curve |
Definition at line 480 of file mphell-jacobi.c.
void jacobi_quartic_point_neg | ( | ec_point_ptr | P3, |
ec_point_srcptr | P1, | ||
ec_curve_srcptr | E | ||
) |
Set P3 to -P1.
P3 | Resulting point |
P1 | Source point |
E | Elliptic curve (Jacobi quartic) |
Definition at line 553 of file mphell-jacobi.c.
void jacobi_quartic_point_norm | ( | ec_point_ptr | P, |
ec_curve_srcptr | E, | ||
uint8_t | stack | ||
) |
Convert a point in extented projective coordinate (X,Y,T,Z) to an affine point (x,y) with x=X/Z, y=Y/Z.
P | Point in extented projective coordinate (X,Y,T,Z) with T=(X^2)/Z |
E | Jacobi quartic elliptic curve |
stack | Temporary memory stack to use |
Definition at line 436 of file mphell-jacobi.c.
void jacobi_quartic_point_random | ( | ec_point_ptr | P, |
ec_curve_srcptr | E, | ||
uint8_t | stack | ||
) |
Create a random point P on the elliptic curve E.
P | Destination point in extented projective coordinate (X,Y,T,Z) with T=(X^2)/Z |
E | Jacobi quartic elliptic curve |
stack | Temporary memory stack to use |
Definition at line 407 of file mphell-jacobi.c.
void jacobi_quartic_point_set_aff | ( | ec_point_ptr | P, |
fe_srcptr | x, | ||
fe_srcptr | y, | ||
field_srcptr | k, | ||
uint8_t | stack | ||
) |
Set dest to the affine point (x,y)
P | Destination point |
x | x-coordinate of the affine point (x,y) |
y | y-coordinate of the affine point (x,y) |
k | Base field |
stack | Temporary memory stack to use |
Definition at line 333 of file mphell-jacobi.c.
void jacobi_quartic_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 (str_x,str_y)
P | Destination point |
str_x | x-coordinate of the affine point (x,y) under string form |
str_y | y-coordinate of the affine point (x,y) under string form |
is_reduced | Set true if str_x and str_y are already reduced in k, false otherwise |
base | Base (either 10 or 16) used for str_x and str_y |
k | Base field |
stack | Temporary memory stack to use |
Definition at line 342 of file mphell-jacobi.c.
void jacobi_quartic_point_set_neutral | ( | ec_point_ptr | dst, |
ec_curve_srcptr | E, | ||
uint8_t | stack | ||
) |
Set dst to the neutral element: (0,1,0,1).
dst | Destination point |
E | Elliptic curve |
stack | Temporary memory stack to use |
Definition at line 323 of file mphell-jacobi.c.
bool jacobi_quartic_verify_random_generation | ( | ec_curve | E, |
const char * | seed, | ||
uint8_t | stack | ||
) |
Test if E if generated from the seed "seed".
E | Elliptic curve to test |
seed | Seed (of 160 bits) used to generate an elliptic curve |
Definition at line 54 of file mphell-jacobi.c.