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

22 lines
515 B
C

#include "crypto_stream_aes256ctr.h"
#include "rq.h"
#include "params.h"
static const unsigned char n[16] = {0};
void rq_fromseed(modq *h,const unsigned char *K)
{
crypto_uint32 buf[768];
int i;
crypto_stream_aes256ctr((unsigned char *) buf,sizeof buf,n,K);
/* will use 761*4 bytes */
/* convenient for aes to generate multiples of 16 bytes */
/* and multiples of more for some implementations */
for (i = 0;i < p;++i)
h[i] = modq_fromuint32(buf[i]);
for (i = p;i < 768;++i)
h[i] = 0;
}