1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-26 17:31:38 +00:00
pqcrypto/crypto_kem/ntruhps2048509/clean/poly_rq_mul.c
John Schanck 0d7743d576 Update NTRU (#311)
* Update NTRU

version: https://github.com/jschanck/ntru/tree/485dde03

* Fixed ntruhrss701/clean/Makefile.Microsoft_nmake
2021-03-24 21:02:46 +00:00

16 lines
422 B
C

#include "poly.h"
void PQCLEAN_NTRUHPS2048509_CLEAN_poly_Rq_mul(poly *r, const poly *a, const poly *b) {
int k, i;
for (k = 0; k < NTRU_N; k++) {
r->coeffs[k] = 0;
for (i = 1; i < NTRU_N - k; i++) {
r->coeffs[k] += a->coeffs[k + i] * b->coeffs[NTRU_N - i];
}
for (i = 0; i < k + 1; i++) {
r->coeffs[k] += a->coeffs[k - i] * b->coeffs[i];
}
}
}