Defined ntru_poly_create_from_seed() and ntru_poly_create_from_data() constructors...
[strongswan.git] / src / libstrongswan / plugins / ntru / ntru_poly.h
index d698f81..55133c5 100644 (file)
@@ -69,10 +69,26 @@ struct ntru_poly_t {
  * @param indices_len_m                number of indices for -1 coefficients
  * @param is_product_form      generate multiple polynomials
  */
-ntru_poly_t *ntru_poly_create(hash_algorithm_t alg, chunk_t seed,
-                                                         uint8_t c_bits, uint16_t N, uint16_t q,
-                                                         uint32_t indices_len_p, uint32_t indices_len_m,
-                                                         bool is_product_form);
+ntru_poly_t *ntru_poly_create_from_seed(hash_algorithm_t alg, chunk_t seed,
+                                                                               uint8_t c_bits, uint16_t N, uint16_t q,
+                                                                               uint32_t indices_len_p,
+                                                                               uint32_t indices_len_m,
+                                                                               bool is_product_form);
+
+/**
+ * Create a trits polynomial from an array of indices of non-zero coefficients
+ *
+ * @param data                         array of indices of non-zero coefficients
+ * @param N                                    ring dimension, number of polynomial coefficients
+ * @param q                                    large modulus
+ * @param indices_len_p                number of indices for +1 coefficients
+ * @param indices_len_m                number of indices for -1 coefficients
+ * @param is_product_form      generate multiple polynomials
+ */
+ntru_poly_t *ntru_poly_create_from_data(uint16_t *data, uint16_t N, uint16_t q,
+                                                                               uint32_t indices_len_p,
+                                                                               uint32_t indices_len_m,
+                                                                               bool is_product_form);
 
 #endif /** NTRU_POLY_H_ @}*/