aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2018-08-26 15:06:16 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2018-08-26 15:06:16 +0800
commitc47fdddc1725bbcfdfcbf110f90a3bf41feffc83 (patch)
treef6b5de135d8ad17fb1a9460694b25afcb6b661a8
parent3c3179038c939e4f3c832797da0edbe587863f34 (diff)
downloaddexon-mcl-c47fdddc1725bbcfdfcbf110f90a3bf41feffc83.tar.gz
dexon-mcl-c47fdddc1725bbcfdfcbf110f90a3bf41feffc83.tar.zst
dexon-mcl-c47fdddc1725bbcfdfcbf110f90a3bf41feffc83.zip
cast of function does not run on mcl-wasm
-rw-r--r--include/mcl/fp_tower.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/mcl/fp_tower.hpp b/include/mcl/fp_tower.hpp
index 1a34d1c..efe8b26 100644
--- a/include/mcl/fp_tower.hpp
+++ b/include/mcl/fp_tower.hpp
@@ -129,6 +129,10 @@ public:
static void sub(FpDblT& z, const FpDblT& x, const FpDblT& y) { Fp::op_.fpDbl_sub(z.v_, x.v_, y.v_, Fp::op_.p); }
static void mod(Fp& z, const FpDblT& xy) { Fp::op_.fpDbl_mod(z.v_, xy.v_, Fp::op_.p); }
#endif
+ static void addPreC(FpDblT& z, const FpDblT& x, const FpDblT& y) { Fp::op_.fpDbl_addPre(z.v_, x.v_, y.v_); }
+ static void subPreC(FpDblT& z, const FpDblT& x, const FpDblT& y) { Fp::op_.fpDbl_subPre(z.v_, x.v_, y.v_); }
+ static void mulPreC(FpDblT& xy, const Fp& x, const Fp& y) { Fp::op_.fpDbl_mulPre(xy.v_, x.v_, y.v_); }
+ static void sqrPreC(FpDblT& xx, const Fp& x) { Fp::op_.fpDbl_sqrPre(xx.v_, x.v_); }
static void (*addPre)(FpDblT& z, const FpDblT& x, const FpDblT& y);
static void (*subPre)(FpDblT& z, const FpDblT& x, const FpDblT& y);
/*
@@ -155,22 +159,22 @@ public:
if (op.fpDbl_addPreA_) {
addPre = (void (*)(FpDblT&, const FpDblT&, const FpDblT&))op.fpDbl_addPreA_;
} else {
- addPre = (void (*)(FpDblT&, const FpDblT&, const FpDblT&))op.fpDbl_addPre;
+ addPre = addPreC;
}
if (op.fpDbl_subPreA_) {
subPre = (void (*)(FpDblT&, const FpDblT&, const FpDblT&))op.fpDbl_subPreA_;
} else {
- subPre = (void (*)(FpDblT&, const FpDblT&, const FpDblT&))op.fpDbl_subPre;
+ subPre = subPreC;
}
if (op.fpDbl_mulPreA_) {
mulPre = (void (*)(FpDblT&, const Fp&, const Fp&))op.fpDbl_mulPreA_;
} else {
- mulPre = (void (*)(FpDblT&, const Fp&, const Fp&))op.fpDbl_mulPre;
+ mulPre = mulPreC;
}
if (op.fpDbl_sqrPreA_) {
sqrPre = (void (*)(FpDblT&, const Fp&))op.fpDbl_sqrPreA_;
} else {
- sqrPre = (void (*)(FpDblT&, const Fp&))op.fpDbl_sqrPre;
+ sqrPre = sqrPreC;
}
}
void operator+=(const FpDblT& x) { add(*this, *this, x); }