2020-10-16 01:00:04 +01:00
|
|
|
#ifndef POLY_H
|
|
|
|
#define POLY_H
|
|
|
|
#include "SABER_params.h"
|
2020-10-28 16:02:04 +00:00
|
|
|
#include <immintrin.h>
|
2020-10-16 01:00:04 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2020-10-28 16:02:04 +00:00
|
|
|
typedef union {
|
2020-10-16 01:00:04 +01:00
|
|
|
uint16_t coeffs[SABER_N];
|
2020-10-28 16:02:04 +00:00
|
|
|
__m256i dummy;
|
2020-10-16 01:00:04 +01:00
|
|
|
} poly;
|
|
|
|
|
2020-10-28 16:02:04 +00:00
|
|
|
typedef union {
|
|
|
|
uint16_t coeffs[4 * SABER_N];
|
|
|
|
__m256i dummy;
|
|
|
|
} toom4_points;
|
2020-10-16 01:00:04 +01:00
|
|
|
|
2020-10-28 16:02:04 +00:00
|
|
|
typedef union {
|
|
|
|
uint16_t coeffs[8 * SABER_N];
|
|
|
|
__m256i dummy;
|
|
|
|
} toom4_points_product;
|
2020-10-16 01:00:04 +01:00
|
|
|
|
2020-10-28 16:02:04 +00:00
|
|
|
void PQCLEAN_SABER_AVX2_MatrixVectorMul(poly c[SABER_L], const poly A[SABER_L][SABER_L], const toom4_points s_eval[SABER_L], int transpose);
|
2020-10-16 01:00:04 +01:00
|
|
|
|
2020-10-28 16:02:04 +00:00
|
|
|
void PQCLEAN_SABER_AVX2_InnerProd(poly *c, const poly b[SABER_L], const toom4_points s_eval[SABER_L]);
|
|
|
|
|
|
|
|
void PQCLEAN_SABER_AVX2_GenMatrix(poly a[SABER_L][SABER_L], const uint8_t seed[SABER_SEEDBYTES]);
|
|
|
|
|
|
|
|
void PQCLEAN_SABER_AVX2_GenSecret(poly s[SABER_L], const uint8_t seed[SABER_NOISESEEDBYTES]);
|
|
|
|
|
|
|
|
|
|
|
|
void PQCLEAN_SABER_AVX2_toom4_interp(poly *res_avx, const toom4_points_product *c_eval);
|
|
|
|
|
|
|
|
void PQCLEAN_SABER_AVX2_toom4_eval(toom4_points *b_eval, const poly *b);
|
|
|
|
|
|
|
|
void PQCLEAN_SABER_AVX2_toom4_mul_A_by_B_eval(toom4_points_product *c_eval, const poly *a_avx, const toom4_points *b_eval, int accumulate);
|
2020-10-16 01:00:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|