39 #include <fmpz_poly.h>
47 const fmpz_poly_t msg_bin,
48 const fmpz_poly_t pub_key,
49 const fmpz_poly_t rnd,
53 fmpz_poly_t tmp_poly_msg;
55 if (!msg_bin || !pub_key || !rnd || !out || !params)
59 fmpz_poly_init(tmp_poly_msg);
60 fmpz_poly_set(tmp_poly_msg, msg_bin);
65 fmpz_poly_add(out, out, tmp_poly_msg);
68 fmpz_poly_clear(tmp_poly_msg);
76 const fmpz_poly_t pub_key,
77 const fmpz_poly_t rnd,
82 fmpz_poly_t **poly_array;
84 if (!msg || !msg->
len)
89 while (*poly_array[i]) {
fmpz_poly_t ** ascii_to_bin_poly_arr(const string *to_poly, const ntru_params *params)
void ntru_encrypt_poly(const fmpz_poly_t msg_bin, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, fmpz_poly_t out, const ntru_params *params)
string * poly_arr_to_base64(const fmpz_poly_t **poly_array, const uint32_t poly_c, const ntru_params *params)
void fmpz_poly_mod_unsigned(fmpz_poly_t a, const uint32_t mod)
#define NTRU_ABORT_DEBUG(...)
header for ntru_poly_ascii.c
string * ntru_encrypt_string(const string *msg, const fmpz_poly_t pub_key, const fmpz_poly_t rnd, const 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)
void poly_delete_array(fmpz_poly_t **poly_array)
header for ntru_ascii_poly.c