aboutsummaryrefslogtreecommitdiffstats
path: root/src/bls_c.cpp
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2018-09-09 10:02:27 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2018-09-09 10:02:30 +0800
commitf68e6c99bbc7e4c607223e73f246b73eaa94d3a8 (patch)
tree47b4bb66520b1563061204bcf09ac1830f379d41 /src/bls_c.cpp
parentfa2dfb07a2966010e8c6eff93ee39ffc8c7c4d20 (diff)
downloaddexon-bls-f68e6c99bbc7e4c607223e73f246b73eaa94d3a8.tar
dexon-bls-f68e6c99bbc7e4c607223e73f246b73eaa94d3a8.tar.gz
dexon-bls-f68e6c99bbc7e4c607223e73f246b73eaa94d3a8.tar.bz2
dexon-bls-f68e6c99bbc7e4c607223e73f246b73eaa94d3a8.tar.lz
dexon-bls-f68e6c99bbc7e4c607223e73f246b73eaa94d3a8.tar.xz
dexon-bls-f68e6c99bbc7e4c607223e73f246b73eaa94d3a8.tar.zst
dexon-bls-f68e6c99bbc7e4c607223e73f246b73eaa94d3a8.zip
update how to load QcoeffTbl
Diffstat (limited to 'src/bls_c.cpp')
-rw-r--r--src/bls_c.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bls_c.cpp b/src/bls_c.cpp
index d46a15c..06a5b0a 100644
--- a/src/bls_c.cpp
+++ b/src/bls_c.cpp
@@ -43,7 +43,14 @@ int blsInitNotThreadSafe(int curve, int maxUnitSize)
g_Qcoeff.resize(BN::param.precomputedQcoeffSize);
assert(g_Qcoeff.size() == CYBOZU_NUM_OF_ARRAY(tbl));
for (size_t i = 0; i < g_Qcoeff.size(); i++) {
- g_Qcoeff[i].setStr(&b, tbl[i], 16);
+ Fp6& x6 = g_Qcoeff[i];
+ for (size_t j = 0; j < 6; j++) {
+ Fp& x = x6.getFp0()[j];
+ mcl::fp::Unit *p = const_cast<mcl::fp::Unit*>(x.getUnit());
+ for (size_t k = 0; k < 4; k++) {
+ p[k] = QcoeffTblBN254[i][j][k];
+ }
+ }
}
} else {
precomputeG2(&b, g_Qcoeff, getQ());