Python-ELMO is a Python library which offers an encapsulation of the binary tool ELMO, in order to manipulate it easily in Python and SageMath script.
Ви не можете вибрати більше 25 тем
Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
|
- #include <stdint.h>
- #include "params.h"
- #include "poly.h"
- #include "ntt.h"
- #include "reduce.h"
-
- /*************************************************
- * Name: poly_ntt
- *
- * Description: Computes negacyclic number-theoretic transform (NTT) of
- * a polynomial in place;
- * inputs assumed to be in normal order, output in bitreversed order
- *
- * Arguments: - uint16_t *r: pointer to in/output polynomial
- **************************************************/
- void poly_ntt(poly *r)
- {
- ntt(r->coeffs);
- poly_reduce(r);
- }
-
- /*************************************************
- * Name: poly_reduce
- *
- * Description: Applies Barrett reduction to all coefficients of a polynomial
- * for details of the Barrett reduction see comments in reduce.c
- *
- * Arguments: - poly *r: pointer to input/output polynomial
- **************************************************/
- void poly_reduce(poly *r)
- {
- int i;
-
- for(i=0;i<KYBER_N;i++)
- r->coeffs[i] = barrett_reduce(r->coeffs[i]);
- }
-
|