Skip to content

Commit

Permalink
Use same modulo as online phase.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed Jan 24, 2018
1 parent bcf898f commit 1d5d521
Showing 1 changed file with 38 additions and 3 deletions.
41 changes: 38 additions & 3 deletions Scripts/gen_input_fp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,52 @@
#include <fstream>
#include "Math/gfp.h"
#include "Processor/Buffer.h"
#include "Tools/ezOptionParser.h"
#include "Math/Setup.h"

using namespace std;

int main() {
int main(int argc, const char** argv) {
ez::ezOptionParser opt;
opt.add(
"128", // Default.
0, // Required?
1, // Number of args expected.
0, // Delimiter if expecting multiple args.
"Bit length of GF(p) field (default: 128)", // Help description.
"-lgp", // Flag token.
"--lgp" // Flag token.
);
opt.add(
"40", // Default.
0, // Required?
1, // Number of args expected.
0, // Delimiter if expecting multiple args.
"Bit length of GF(2^n) field (default: 40)", // Help description.
"-lg2", // Flag token.
"--lg2" // Flag token.
);
opt.add(
"2", // Default.
0, // Required?
1, // Number of args expected.
0, // Delimiter if expecting multiple args.
"Number of parties (default: 2).", // Help description.
"-N", // Flag token.
"--nparties" // Flag token.
);
opt.parse(argc, argv);
int nparties, lgp, lg2;
opt.get("-N")->getInt(nparties);
opt.get("-lgp")->getInt(lgp);
opt.get("-lg2")->getInt(lg2);
read_setup(nparties, lgp, lg2);

const char* input_name = "gfp_vals.in";
const char* output_name = "gfp_vals.out";
ifstream cin(input_name);
ofstream cout(output_name);

gfp::init_field(bigint("172035116406933162231178957667602464769"));

int n; cin >> n;
for (int i = 0; i < n; ++i) {
bigint a;
Expand Down

0 comments on commit 1d5d521

Please sign in to comment.