write code in stream mode

This commit is contained in:
Jordi Baylina
2020-01-27 13:08:11 +07:00
parent 20058a38d6
commit 3a9766a008
9 changed files with 108 additions and 45 deletions

View File

@@ -35,7 +35,7 @@ async function testField(prime, test) {
` ${path.join(dir.path, "fr.o")}` +
` ${path.join(dir.path, "fr.c")}` +
` -o ${path.join(dir.path, "tester")}` +
" -lgmp"
" -lgmp -g"
);
const inLines = [];

View File

@@ -63,7 +63,6 @@ char *<%=name%>_element2str(P<%=name%>Element pE) {
} else {
mpz_init_set_si(r, pE->shortVal);
mpz_add(r, r, q);
mpz_clear(q);
}
} else {
<%=name%>_toNormal(pE);

View File

@@ -8,8 +8,8 @@
#define Fr_LONGMONTGOMERY 0xC0000000
typedef struct __attribute__((__packed__)) {
int32_t shortVal;
u_int32_t type;
u_int64_t longVal[Fr_N64];
uint32_t type;
uint64_t longVal[Fr_N64];
} FrElement;
typedef FrElement *PFrElement;
extern FrElement Fr_q;

View File

@@ -8,8 +8,8 @@
#define <%=name%>_LONGMONTGOMERY 0xC0000000
typedef struct __attribute__((__packed__)) {
int32_t shortVal;
u_int32_t type;
u_int64_t longVal[<%=name%>_N64];
uint32_t type;
uint64_t longVal[<%=name%>_N64];
} <%=name%>Element;
typedef <%=name%>Element *P<%=name%>Element;
extern <%=name%>Element <%=name%>_q;

View File

@@ -5,6 +5,7 @@
#include <iomanip>
#include <stdlib.h>
#include <assert.h>
#include <stdarg.h>
#include <thread>
#include "calcwit.h"
#include "utils.h"