a tool to precompute G2

dev
MITSUNARI Shigeo 6 years ago
parent ef892e34c4
commit 9482dfd45e
  1. 18
      misc/precompute.cpp

@ -0,0 +1,18 @@
#include <mcl/bn384.hpp>
#include <iostream>
using namespace mcl::bn;
int main()
{
initPairing(mcl::BN254);
G2 Q;
mapToG2(Q, 1);
std::vector<Fp6> Qcoeff;
precomputeG2(Qcoeff, Q);
printf("static const char *tbl[%d] = {\n", (int)Qcoeff.size());
for (size_t i = 0; i < Qcoeff.size(); i++) {
printf("\"%s\",\n", Qcoeff[i].getStr(16).c_str());
}
puts("};");
}
Loading…
Cancel
Save