You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/crypto/ntruprime-20171206/crypto_kem/ntrulpr4591761/avx/rq_top.c

18 lines
365 B
C

#include "rq.h"
void rq_top(unsigned char *c,const modq *f,const unsigned char *r)
{
modq T[256];
int i;
for (i = 0;i < 256;++i) {
modq x = f[i];
x = modq_sum(x,2295 * (1 & (r[i / 8] >> (i & 7))));
x = ((x + 2156) * 114 + 16384) >> 15;
T[i] = x; /* between 0 and 15 */
}
for (i = 0;i < 128;++i)
*c++ = T[2*i] + (T[2*i + 1] << 4);
}