2019-01-16 09:15:18 +00:00
|
|
|
#ifndef POLYVEC_H
|
|
|
|
#define POLYVEC_H
|
|
|
|
|
|
|
|
#include "params.h"
|
|
|
|
#include "poly.h"
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/* Vectors of polynomials of length L */
|
|
|
|
typedef struct {
|
2019-01-16 10:02:32 +00:00
|
|
|
poly vec[L];
|
2019-01-16 09:15:18 +00:00
|
|
|
} polyvecl;
|
|
|
|
|
2019-01-22 16:38:22 +00:00
|
|
|
void PQCLEAN_DILITHIUMIII_polyvecl_freeze(polyvecl *v);
|
2019-01-16 09:15:18 +00:00
|
|
|
|
2019-01-22 16:38:22 +00:00
|
|
|
void PQCLEAN_DILITHIUMIII_polyvecl_add(polyvecl *w, const polyvecl *u,
|
|
|
|
const polyvecl *v);
|
2019-01-16 09:15:18 +00:00
|
|
|
|
2019-01-22 16:38:22 +00:00
|
|
|
void PQCLEAN_DILITHIUMIII_polyvecl_ntt(polyvecl *v);
|
|
|
|
void PQCLEAN_DILITHIUMIII_polyvecl_pointwise_acc_invmontgomery(
|
|
|
|
poly *w, const polyvecl *u, const polyvecl *v);
|
2019-01-16 09:15:18 +00:00
|
|
|
|
2019-01-22 16:38:22 +00:00
|
|
|
int PQCLEAN_DILITHIUMIII_polyvecl_chknorm(const polyvecl *v, uint32_t bound);
|
2019-01-16 09:15:18 +00:00
|
|
|
|
|
|
|
/* Vectors of polynomials of length K */
|
|
|
|
typedef struct {
|
2019-01-16 10:02:32 +00:00
|
|
|
poly vec[K];
|
2019-01-16 09:15:18 +00:00
|
|
|
} polyveck;
|
|
|
|
|
2019-01-22 16:38:22 +00:00
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_reduce(polyveck *v);
|
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_csubq(polyveck *v);
|
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_freeze(polyveck *v);
|
|
|
|
|
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_add(polyveck *w, const polyveck *u,
|
|
|
|
const polyveck *v);
|
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_sub(polyveck *w, const polyveck *u,
|
|
|
|
const polyveck *v);
|
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_shiftl(polyveck *v, unsigned int k);
|
|
|
|
|
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_ntt(polyveck *v);
|
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_invntt_montgomery(polyveck *v);
|
|
|
|
|
|
|
|
int PQCLEAN_DILITHIUMIII_polyveck_chknorm(const polyveck *v, uint32_t bound);
|
|
|
|
|
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_power2round(polyveck *v1, polyveck *v0,
|
2019-02-13 16:45:09 +00:00
|
|
|
const polyveck *v);
|
2019-01-22 16:38:22 +00:00
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_decompose(polyveck *v1, polyveck *v0,
|
2019-02-13 16:45:09 +00:00
|
|
|
const polyveck *v);
|
2019-01-22 16:38:22 +00:00
|
|
|
unsigned int PQCLEAN_DILITHIUMIII_polyveck_make_hint(polyveck *h,
|
2019-02-13 16:45:09 +00:00
|
|
|
const polyveck *u,
|
|
|
|
const polyveck *v);
|
2019-01-22 16:38:22 +00:00
|
|
|
void PQCLEAN_DILITHIUMIII_polyveck_use_hint(polyveck *w, const polyveck *u,
|
2019-02-13 16:45:09 +00:00
|
|
|
const polyveck *h);
|
2019-01-16 09:15:18 +00:00
|
|
|
|
|
|
|
#endif
|