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_right.c

22 lines
455 B
C

#include "rq.h"
#include "params.h"
void rq_rightsubbit(unsigned char *r,const unsigned char *c,const modq *ab)
{
modq t[256];
int i;
for (i = 0;i < 128;++i) {
crypto_uint32 x = c[i];
t[2*i] = (x & 15) * 287 - 2007;
t[2*i+1] = (x >> 4) * 287 - 2007;
}
for (i = 0;i < 256;++i)
t[i] = -(modq_freeze(t[i] - ab[i] + 4*w+1) >> 14);
for (i = 0;i < 32;++i) r[i] = 0;
for (i = 0;i < 256;++i)
r[i / 8] |= (t[i] << (i & 7));
}