37 #include <fmpz_poly.h>
58 if (!f || !g || !params)
72 fmpz_poly_scalar_mul_ui(pub, pub, params->
p);
75 fmpz_poly_init(pair->
priv);
77 fmpz_poly_init(pair->
pub);
79 fmpz_poly_set(pair->
priv, f);
81 fmpz_poly_set(pair->
pub, pub);
118 fmpz_poly_init(priv_u);
119 fmpz_poly_set(priv_u, priv);
125 fmpz_poly_clear(priv_u);
137 fmpz_poly_t **imported;
147 fmpz_poly_set(pub, **imported);
159 fmpz_poly_t priv_inv,
163 fmpz_poly_t **imported,
178 fmpz_poly_set(priv, **imported);
185 fmpz_poly_set(priv_inv, Fp);
200 fmpz_poly_clear(pair->
priv);
201 fmpz_poly_clear(pair->
pub);
bool poly_inverse_poly_q(const fmpz_poly_t a, fmpz_poly_t Fq, const ntru_params *params)
void string_delete(string *del_string)
header for ntru_keypair.c
void ntru_delete_keypair(keypair *pair)
void fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod)
bool write_file(string const *wstring, char const *const filename)
void fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod)
#define NTRU_ABORT_DEBUG(...)
bool poly_inverse_poly_p(const fmpz_poly_t a, fmpz_poly_t Fp, const ntru_params *params)
fmpz_poly_t ** base64_to_poly_arr(const string *to_poly, const ntru_params *params)
header for ntru_poly_ascii.c
string * read_file(char const *const filename)
void export_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
void poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus)
string * poly_to_base64(const fmpz_poly_t poly, const ntru_params *params)
void poly_delete_array(fmpz_poly_t **poly_array)
bool ntru_create_keypair(fmpz_poly_t f, fmpz_poly_t g, keypair *pair, ntru_params *params)
void export_priv_key(char const *const filename, fmpz_poly_t priv, ntru_params *params)
void import_public_key(char const *const filename, fmpz_poly_t pub, ntru_params *params)
void import_priv_key(char const *const filename, fmpz_poly_t priv, fmpz_poly_t priv_inv, ntru_params *params)
header for ntru_ascii_poly.c