#include "inttypes.h" #include "ntt.h" #include "params.h" #include "reduce.h" extern const uint16_t omegas_inv_bitrev_montgomery[]; extern const uint16_t psis_inv_montgomery[]; extern const uint16_t zetas[]; /************************************************* * Name: ntt * * Description: Computes negacyclic number-theoretic transform (NTT) of * a polynomial (vector of 256 coefficients) in place; * inputs assumed to be in normal order, output in bitreversed order * * Arguments: - uint16_t *p: pointer to in/output polynomial **************************************************/ void ntt(uint16_t *p) { int level, start, j, k; uint16_t zeta, t; k = 1; for(level = 7; level >= 0; level--) { for(start = 0; start < KYBER_N; start = j + (1<