CRS
Isogeny-based post-quantum Diffie-Hellman protocol.
|
#include "memory.h"
Functions | |
void | SW_curve_init (SW_curve_t *E, const fq_ctx_t *F) |
void | SW_curve_set (SW_curve_t *E, const fq_ctx_t *F, const fq_t a, const fq_t b) |
void | SW_curve_set_si (SW_curve_t *E, const fq_ctx_t *F, const slong a, const slong b) |
void | SW_curve_set_su (SW_curve_t *E, const fq_ctx_t *F, const ulong a, const ulong b) |
int | SW_curve_set_str (SW_curve_t *E, const fq_ctx_t *F, const char *str_a, const char *str_b, int b) |
void | SW_curve_clear (SW_curve_t *E) |
void | SW_point_init (SW_point_t *P, SW_curve_t *E) |
void | SW_point_set (SW_point_t *P, const fq_t x, const fq_t y, const fq_t z, SW_curve_t *E) |
void | SW_point_set_si (SW_point_t *P, const slong x, const slong y, const slong z, SW_curve_t *E) |
void | SW_point_set_ui (SW_point_t *P, const ulong x, const ulong y, const ulong z, SW_curve_t *E) |
void | SW_point_clear (SW_point_t *P) |
void | MG_curve_init (MG_curve_t *E, const fq_ctx_t *F) |
void | MG_curve_set_ (MG_curve_t *rop, MG_curve_t *op) |
void | MG_curve_set (MG_curve_t *E, const fq_ctx_t *F, const fq_t A, const fq_t B) |
void | MG_curve_set_si (MG_curve_t *E, const fq_ctx_t *F, const slong A, const slong B) |
void | MG_curve_set_ui (MG_curve_t *E, const fq_ctx_t *F, const ulong A, const ulong B) |
int | MG_curve_set_str (MG_curve_t *E, const fq_ctx_t *F, const char *str_A, const char *str_B, int b) |
void | MG_curve_clear (MG_curve_t *E) |
void | MG_point_init (MG_point_t *P, MG_curve_t *E) |
void | MG_point_set (MG_point_t *P, const fq_t X, const fq_t Z, MG_curve_t *E) |
void | MG_point_set_ (MG_point_t *P, MG_point_t *Q) |
void | MG_point_set_si (MG_point_t *P, const slong X, const slong Z, MG_curve_t *E) |
void | MG_point_set_ui (MG_point_t *P, const ulong X, const ulong Z, MG_curve_t *E) |
void | MG_point_set_fmpz (MG_point_t *P, const fmpz_t X, const fmpz_t Z, MG_curve_t *E) |
void | MG_point_set_str (MG_point_t *P, const char *X, const char *Z, MG_curve_t *E) |
void | MG_point_set_infty (MG_point_t *P) |
void | MG_point_clear (MG_point_t *P) |
void | TN_curve_init (TN_curve_t *E, fmpz_t l, const fq_ctx_t *F) |
void | TN_curve_set (TN_curve_t *E, const fq_t b, const fq_t c, fmpz_t l, const fq_ctx_t *F) |
void | TN_curve_set_ (TN_curve_t *rop, TN_curve_t *op) |
void | TN_curve_set_si (TN_curve_t *E, const slong b, const slong c, const slong l, const fq_ctx_t *F) |
void | TN_curve_set_ui (TN_curve_t *E, const ulong b, const ulong c, ulong l, const fq_ctx_t *F) |
int | TN_curve_set_str (TN_curve_t *E, const char *str_b, const char *str_c, const char *str_l, int base, const fq_ctx_t *F) |
void | TN_curve_clear (TN_curve_t *E) |
void MG_curve_clear | ( | MG_curve_t * | E | ) |
Clears the given curve, releasing any memory used. It must be reinitialised in order to be used again.
void MG_curve_init | ( | MG_curve_t * | E, |
const fq_ctx_t * | F | ||
) |
Initializes E for use, with context F, and setting its coefficients to zero. A corresponding call to MG_curve_clear() must be made after finishing with the MG_curve_t to free the memory used by the curve.
void MG_curve_set | ( | MG_curve_t * | E, |
const fq_ctx_t * | F, | ||
const fq_t | A, | ||
const fq_t | B | ||
) |
Sets E to elliptic curve over F in Montgomery form with coefficients A and B. Curve parameters are given as elements of F.
void MG_curve_set_ | ( | MG_curve_t * | rop, |
MG_curve_t * | op | ||
) |
Sets elliptic curve rop in Montgomery form to curve op. This is aking to a deep copy. rop must be initialized.
void MG_curve_set_si | ( | MG_curve_t * | E, |
const fq_ctx_t * | F, | ||
const slong | A, | ||
const slong | B | ||
) |
See MG_curve_set(). Curve coefficients are given as signed integers.
int MG_curve_set_str | ( | MG_curve_t * | E, |
const fq_ctx_t * | F, | ||
const char * | str_A, | ||
const char * | str_B, | ||
int | b | ||
) |
See MG_curve_set(). Parameters are given as null-terminated strings, in base b. The base b can vary between 2 and 62, inclusive. Returns 0 if the string contain valid inputs and −1 otherwise.
void MG_curve_set_ui | ( | MG_curve_t * | E, |
const fq_ctx_t * | F, | ||
const ulong | A, | ||
const ulong | B | ||
) |
See MG_curve_set(). Curve coefficients are given as unsigned integers.
void MG_point_clear | ( | MG_point_t * | P | ) |
Clears the given point, releasing anZ memorZ used. It must be reinitialised in order to be used again.
void MG_point_init | ( | MG_point_t * | P, |
MG_curve_t * | E | ||
) |
Initializes P for use, with context F, and setting its coefficients to zero. A corresponding call to SW_point_clear() must be made after finishing with the SW_point_t to free the memorZ used bZ the curve. TODO: swap F for E in parameters. A point is member of E not of F.
void MG_point_set | ( | MG_point_t * | P, |
const fq_t | X, | ||
const fq_t | Z, | ||
MG_curve_t * | E | ||
) |
Sets P to point of elliptic curve E with coordinates X, Z, z. Point parameters are given as elements of F. TODO: Check if P and E's fields are correct
void MG_point_set_ | ( | MG_point_t * | P, |
MG_point_t * | Q | ||
) |
Sets P to the same point as Q.
void MG_point_set_fmpz | ( | MG_point_t * | P, |
const fmpz_t | X, | ||
const fmpz_t | Z, | ||
MG_curve_t * | E | ||
) |
See MG_point_set(). Point coordinates are given as strings of integers.
void MG_point_set_infty | ( | MG_point_t * | P | ) |
Sets P to the point at infinity on the underlying curve.
void MG_point_set_si | ( | MG_point_t * | P, |
const slong | X, | ||
const slong | Z, | ||
MG_curve_t * | E | ||
) |
See MG_point_set(). Point coordinates are given as signed integers.
void MG_point_set_str | ( | MG_point_t * | P, |
const char * | X, | ||
const char * | Z, | ||
MG_curve_t * | E | ||
) |
See MG_point_set(). Point coordinates are given as strings of integers.
void MG_point_set_ui | ( | MG_point_t * | P, |
const ulong | X, | ||
const ulong | Z, | ||
MG_curve_t * | E | ||
) |
See MG_point_set(). Point coordinates are given as unsigned integers.
void SW_curve_clear | ( | SW_curve_t * | E | ) |
Clears the given curve, releasing any memory used. It must be reinitialised in order to be used again.
void SW_curve_init | ( | SW_curve_t * | E, |
const fq_ctx_t * | F | ||
) |
Initializes E for use, with context F, and setting its coefficients to zero. A corresponding call to SW_curve_clear() must be made after finishing with the SW_curve_t to free the memory used by the curve.
void SW_curve_set | ( | SW_curve_t * | E, |
const fq_ctx_t * | F, | ||
const fq_t | a, | ||
const fq_t | b | ||
) |
Sets E to elliptic curve over F in Weierstrass form with coefficients a and b. Curve parameters are given as elements of F.
void SW_curve_set_si | ( | SW_curve_t * | E, |
const fq_ctx_t * | F, | ||
const slong | a, | ||
const slong | b | ||
) |
See SW_curve_set(). Curve coefficients are given as signed integers.
int SW_curve_set_str | ( | SW_curve_t * | E, |
const fq_ctx_t * | F, | ||
const char * | str_a, | ||
const char * | str_b, | ||
int | b | ||
) |
See SW_curve_set(). Parameters are given as null-terminated strings, in base b. The base b can vary between 2 and 62, inclusive. Returns 0 if the string contain valid inputs and −1 otherwise.
void SW_curve_set_su | ( | SW_curve_t * | E, |
const fq_ctx_t * | F, | ||
const ulong | a, | ||
const ulong | b | ||
) |
See SW_curve_set(). Curve coefficients are given as unsigned integers.
void SW_point_clear | ( | SW_point_t * | P | ) |
Clears the given point, releasing any memory used. It must be reinitialised in order to be used again.
void SW_point_init | ( | SW_point_t * | P, |
SW_curve_t * | E | ||
) |
Initializes P for use, with context F, and setting its coefficients to zero. A corresponding call to SW_point_clear() must be made after finishing with the SW_point_t to free the memory used by the curve. TODO: swap F for E in parameters. A point is member of E not of F.
void SW_point_set | ( | SW_point_t * | P, |
const fq_t | x, | ||
const fq_t | y, | ||
const fq_t | z, | ||
SW_curve_t * | E | ||
) |
Sets P to point of elliptic curve E with coordinates x, y, z. Point parameters are given as elements of F. TODO: Check if P and E's fields are correct
void SW_point_set_si | ( | SW_point_t * | P, |
const slong | x, | ||
const slong | y, | ||
const slong | z, | ||
SW_curve_t * | E | ||
) |
See SW_point_set(). Point coordinates are given as signed integers.
void SW_point_set_ui | ( | SW_point_t * | P, |
const ulong | x, | ||
const ulong | y, | ||
const ulong | z, | ||
SW_curve_t * | E | ||
) |
See SW_point_set(). Point coordinates are given as unsigned integers.
void TN_curve_clear | ( | TN_curve_t * | E | ) |
Clears the given curve, releasing any memory used. It must be reinitialised in order to be used again.
void TN_curve_init | ( | TN_curve_t * | E, |
fmpz_t | l, | ||
const fq_ctx_t * | F | ||
) |
Initializes E for use, with context F, and setting its coefficients to zero. A corresponding call to TN_curve_clear() must be made after finishing with the TN_curve_t to free the memory used by the curve.
void TN_curve_set | ( | TN_curve_t * | E, |
const fq_t | b, | ||
const fq_t | c, | ||
fmpz_t | l, | ||
const fq_ctx_t * | F | ||
) |
Sets E to elliptic curve over F in Tate-normal form with coefficients A and B. Curve parameters are given as elements of F.
void TN_curve_set_ | ( | TN_curve_t * | rop, |
TN_curve_t * | op | ||
) |
Deep copy
void TN_curve_set_si | ( | TN_curve_t * | E, |
const slong | b, | ||
const slong | c, | ||
const slong | l, | ||
const fq_ctx_t * | F | ||
) |
See TN_curve_set(). Curve coefficients are given as signed integers.
int TN_curve_set_str | ( | TN_curve_t * | E, |
const char * | str_b, | ||
const char * | str_c, | ||
const char * | str_l, | ||
int | base, | ||
const fq_ctx_t * | F | ||
) |
See TN_curve_set(). Parameters are given as null-terminated strings, in base b. The base b can vary between 2 and 62, inclusive. Returns 0 if the string contain valid inputs and −1 otherwise.
void TN_curve_set_ui | ( | TN_curve_t * | E, |
const ulong | b, | ||
const ulong | c, | ||
ulong | l, | ||
const fq_ctx_t * | F | ||
) |
See TN_curve_set(). Curve coefficients are given as unsigned integers.