1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-27 09:51:30 +00:00
pqcrypto/crypto_kem/lightsaber/avx2/poly.h

39 lines
1.1 KiB
C
Raw Normal View History

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