39 #include <fmpz_poly.h>
47 const fmpz_poly_t encr_msg,
48 const fmpz_poly_t priv_key,
49 const fmpz_poly_t priv_key_inv,
58 if (!encr_msg || !priv_key || !priv_key_inv || !out_bin || !params)
68 fmpz_poly_init(priv_key_tmp);
69 fmpz_poly_init(priv_key_inv_tmp);
70 fmpz_poly_init(encr_msg_tmp);
71 fmpz_poly_set(priv_key_tmp, priv_key);
72 fmpz_poly_set(priv_key_inv_tmp, priv_key_inv);
73 fmpz_poly_set(encr_msg_tmp, encr_msg);
84 fmpz_poly_clear(priv_key_tmp);
85 fmpz_poly_clear(priv_key_inv_tmp);
86 fmpz_poly_clear(encr_msg_tmp);
93 const string *encr_msg,
94 const fmpz_poly_t priv_key,
95 const fmpz_poly_t priv_key_inv,
100 fmpz_poly_t **poly_array;
102 if (!encr_msg || !encr_msg->
len)
107 while (*poly_array[i]) {
void fmpz_poly_mod(fmpz_poly_t a, const uint32_t mod)
#define NTRU_ABORT_DEBUG(...)
fmpz_poly_t ** base64_to_poly_arr(const string *to_poly, const ntru_params *params)
header for ntru_decrypt.c
header for ntru_poly_ascii.c
void poly_starmultiply(const fmpz_poly_t a, const fmpz_poly_t b, fmpz_poly_t c, const ntru_params *params, uint32_t modulus)
void poly_delete_array(fmpz_poly_t **poly_array)
string * bin_poly_arr_to_ascii(const fmpz_poly_t **bin_poly_arr, const uint32_t poly_c, const ntru_params *params)
void ntru_decrypt_poly(const fmpz_poly_t encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, fmpz_poly_t out_bin, const ntru_params *params)
string * ntru_decrypt_string(const string *encr_msg, const fmpz_poly_t priv_key, const fmpz_poly_t priv_key_inv, const ntru_params *params)
header for ntru_ascii_poly.c