Fq
static void Rounded_decode(Fq *r,const unsigned char *s)
Fq h[p];
Fq h[p];
Fq c[p];
Fq c[p];
Fq A[p];
Fq A[p];
Fq B[p];
Fq B[p];
static Fq Fq_freeze(int32 x)
static Fq Fq_recip(Fq a1)
Fq ai = a1;
static int8 Top(Fq C)
static Fq Right(int8 T)
static void R3_fromRq(small *out,const Fq *r)
static void Rq_mult_small(Fq *h,const Fq *f,const small *g)
Fq fg[p+p-1];
Fq result;
static void Rq_mult3(Fq *h,const Fq *f)
static int Rq_recip3(Fq *out,const small *in)
Fq f[p+1],g[p+1],v[p+1],r[p+1];
Fq scale;
static void Round(Fq *out,const Fq *a)
static void KeyGen(Fq *h,small *f,small *ginv)
Fq finv[p];
static void Encrypt(Fq *c,const small *r,const Fq *h)
Fq hr[p];
static void Decrypt(small *r,const Fq *c,const small *f,const small *ginv)
Fq cf[p];
Fq cf3[p];
static void KeyGen(Fq *A,small *a,const Fq *G)
Fq aG[p];
static void Encrypt(Fq *B,int8 *T,const int8 *r,const Fq *G,const Fq *A,const small *b)
Fq bG[p];
Fq bA[p];
static void Decrypt(int8 *r,const Fq *B,const int8 *T,const small *a)
Fq aB[p];
static void Generator(Fq *G,const unsigned char *k)
static void XKeyGen(unsigned char *S,Fq *A,small *a)
Fq G[p];
static void XEncrypt(Fq *B,int8 *T,const int8 *r,const unsigned char *S,const Fq *A)
Fq G[p];
static void Rq_encode(unsigned char *s,const Fq *r)
static void Rq_decode(Fq *r,const unsigned char *s)
for (i = 0;i < p;++i) r[i] = ((Fq)R[i])-q12;
static void Rounded_encode(unsigned char *s,const Fq *r)
static Fq Fq_freeze(int32_t x) {
static void R3_fromRq(small *out, const Fq *r) {
static void Rq_mult_small(Fq *h, const Fq *f, const small *g) {
static void Rq_mult3(Fq *h, const Fq *f) {
static Fq Fq_recip(Fq a1) {
Fq ai = a1;
static int Rq_recip3(Fq *out, const small *in) {
Fq f[p + 1], g[p + 1], v[p + 1], r[p + 1], scale;
static void Round(Fq *out, const Fq *a) {
static void KeyGen(Fq *h, small *f, small *ginv) {
Fq finv[p];
static void Encrypt(Fq *c, const small *r, const Fq *h) {
Fq hr[p];
static void Decrypt(small *r, const Fq *c, const small *f, const small *ginv) {
Fq cf[p], cf3[p];
static void Rq_encode(unsigned char *s, const Fq *r) {
static void Rq_decode(Fq *r, const unsigned char *s) {
for (i = 0; i < p; ++i) r[i] = ((Fq)R[i]) - q12;
static void Rounded_encode(unsigned char *s, const Fq *r) {
static void Rounded_decode(Fq *r, const unsigned char *s) {
Fq h[p];
Fq h[p], c[p];
Fq c[p];