//
//  poly.h

#ifndef poly_h
#define poly_h



#include <stdint.h>

void poly_add(uint16_t *c, const uint16_t *a, const uint16_t *b);
void poly_pointwise(uint16_t *c, uint16_t *a, uint16_t *b);
void poly_tobyte(unsigned char *a,uint16_t *r);
void byte_topoly(unsigned char *a, uint16_t * r);
void poly_ntt(uint16_t * r);
void poly_invntt(uint16_t *r);
void poly_gen_a(uint16_t *a, const unsigned char *seed);
void kntt(uint16_t *r);
void k_pointwise(uint16_t *h ,uint16_t *f, uint16_t *g);
void kinv_ntt(uint16_t *r);
void poly_sample(uint16_t *r, unsigned char * seed,unsigned char nonce);
int  verify(const unsigned char *a, const unsigned char *b, size_t len);
void cmov(unsigned char *r, const unsigned char *x, size_t len, unsigned char b);
uint16_t barrett_reduce(uint16_t a);
uint16_t montgomery_reduce(uint32_t a);
#endif /* poly_h */
