aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-03-25 10:49:18 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-03-25 10:49:18 +0800
commit1937ca971ba4485491135fe3089778245f18704d (patch)
tree0be2aee6ca1af1f6443c84d182f9fd57b1db9d55
parenta0402e567bf6a8e33c8e21b780251cdaa7027884 (diff)
downloadtangerine-mcl-1937ca971ba4485491135fe3089778245f18704d.tar.gz
tangerine-mcl-1937ca971ba4485491135fe3089778245f18704d.tar.zst
tangerine-mcl-1937ca971ba4485491135fe3089778245f18704d.zip
llvm_mont is faster for bn384
-rw-r--r--sample/rawbench.cpp2
-rw-r--r--src/fp.cpp2
-rw-r--r--test/bn384_test.cpp1
3 files changed, 2 insertions, 3 deletions
diff --git a/sample/rawbench.cpp b/sample/rawbench.cpp
index 8a86682..4a596c4 100644
--- a/sample/rawbench.cpp
+++ b/sample/rawbench.cpp
@@ -169,7 +169,7 @@ int main(int argc, char *argv[])
benchRaw(tbl[i], mcl::fp::FP_LLVM_MONT);
#endif
#ifdef MCL_USE_XBYAK
- if (bitSize <= 256) {
+ if (bitSize <= 384) {
benchRaw(tbl[i], mcl::fp::FP_XBYAK);
}
#endif
diff --git a/src/fp.cpp b/src/fp.cpp
index 08f4b90..490699e 100644
--- a/src/fp.cpp
+++ b/src/fp.cpp
@@ -359,7 +359,7 @@ void Op::init(const std::string& mstr, size_t maxBitSize, Mode mode)
*/
#ifdef MCL_USE_XBYAK
if (mode == fp::FP_AUTO) mode = fp::FP_XBYAK;
- if (mode == fp::FP_XBYAK && bitSize > 521) {
+ if (mode == fp::FP_XBYAK && bitSize > 256) {
mode = fp::FP_AUTO;
}
if (!fp::isEnableJIT()) {
diff --git a/test/bn384_test.cpp b/test/bn384_test.cpp
index d88c025..1ae48ad 100644
--- a/test/bn384_test.cpp
+++ b/test/bn384_test.cpp
@@ -26,7 +26,6 @@ void testCurve(const mcl::bn::CurveParam& cp)
G2::mul(bQ, Q, b);
BN::pairing(e2, aP, bQ);
GT::pow(e1, e1, a * b);
- std::cout << e1 << std::endl;
CYBOZU_TEST_EQUAL(e1, e2);
CYBOZU_BENCH("pairing", BN::pairing, e1, P, Q);
CYBOZU_BENCH("finalExp", BN::finalExp, e1, e1);