diff --git a/misc/precompute.cpp b/misc/precompute.cpp new file mode 100644 index 0000000..5661159 --- /dev/null +++ b/misc/precompute.cpp @@ -0,0 +1,18 @@ +#include +#include + +using namespace mcl::bn; + +int main() +{ + initPairing(mcl::BN254); + G2 Q; + mapToG2(Q, 1); + std::vector 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("};"); +}