#ifndef POLY_H
#define POLY_H

#include <stdint.h>
#include "params.h"

typedef struct {
  int32_t coeffs[N];
} __attribute__((aligned(32))) poly;

void poly_uniform(poly *r,const int32_t *pdata);
void poly_binary(poly *r);
double poly_sprod(const poly *a,const poly *b);
double poly_norm(const poly *a);
void poly_reduce(poly *r,const int32_t *pdata);
void poly_csubp(poly *r,const int32_t *pdata);
void poly_caddp(poly *r,const int32_t *pdata);
void poly_neg(poly *r,const poly *a);
void poly_add(poly *r,const poly *a,const poly *b);
void poly_sub(poly *r,const poly *a,const poly *b);
void poly_ntt(poly *a,const int32_t *pdata);
void poly_invntt(poly *a,const int32_t *pdata);
void poly_pointwise(poly *r,const poly *a,const poly *b,const int32_t *pdata);
void poly_scale(poly *r,const poly *a,const int32_t *pdata,int32_t s);
void poly_quot(poly *r,const poly *a,const int32_t *pdata);
void poly_sigmam1(poly *r,const poly *a);
void poly_sigma5(poly *r,const poly *a);
void poly_sigma5inv(poly *r,const poly *a);

#endif
