aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-09-18 14:29:01 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-09-18 14:29:01 +0800
commit9afa137935ace8a18d5d68436eab22110fee6c62 (patch)
tree887b38f522b17b591e15fb91eaa1eefa2816e252
parent5c43cc4e0f4c0223f54f066a4ecc8545dc33fdce (diff)
downloadtangerine-mcl-9afa137935ace8a18d5d68436eab22110fee6c62.tar.gz
tangerine-mcl-9afa137935ace8a18d5d68436eab22110fee6c62.tar.zst
tangerine-mcl-9afa137935ace8a18d5d68436eab22110fee6c62.zip
128-bit security BN curve is ok
-rw-r--r--Makefile2
-rw-r--r--include/mcl/bn.hpp8
2 files changed, 3 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index afc2d3d..482c61f 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ LIB_DIR=lib
OBJ_DIR=obj
EXE_DIR=bin
SRC_SRC=fp.cpp bn_c256.cpp bn_c384.cpp
-TEST_SRC=fp_test.cpp ec_test.cpp fp_util_test.cpp window_method_test.cpp elgamal_test.cpp fp_tower_test.cpp gmp_test.cpp bn_test.cpp bn384_test.cpp glv_test.cpp paillier_test.cpp she_test.cpp vint_test.cpp #bn512_test.cpp
+TEST_SRC=fp_test.cpp ec_test.cpp fp_util_test.cpp window_method_test.cpp elgamal_test.cpp fp_tower_test.cpp gmp_test.cpp bn_test.cpp bn384_test.cpp glv_test.cpp paillier_test.cpp she_test.cpp vint_test.cpp bn512_test.cpp
TEST_SRC+=bn_c256_test.cpp bn_c384_test.cpp
ifeq ($(CPU),x86-64)
MCL_USE_XBYAK?=1
diff --git a/include/mcl/bn.hpp b/include/mcl/bn.hpp
index 9b94a36..148eece 100644
--- a/include/mcl/bn.hpp
+++ b/include/mcl/bn.hpp
@@ -33,7 +33,7 @@ const CurveParam CurveFp254BNb = { "-0x4080000000000001", 2, 1 }; // -(2^62 + 2^
// provisional(experimental) param with maxBitSize = 384
const CurveParam CurveFp382_1 = { "-0x400011000000000000000001", 2, 1 }; // -(2^94 + 2^76 + 2^72 + 1) // A Family of Implementation-Friendly BN Elliptic Curves
const CurveParam CurveFp382_2 = { "-0x400040090001000000000001", 2, 1 }; // -(2^94 + 2^78 + 2^67 + 2^64 + 2^48 + 1) // used in relic-toolkit
-const CurveParam CurveFp462 = { "0x4001fffffffffffffffffffffbfff", -4, 1 }; // 2^114 + 2^101 - 2^14 - 1 // https://eprint.iacr.org/2017/334
+const CurveParam CurveFp462 = { "0x4001fffffffffffffffffffffbfff", 5, 2 }; // 2^114 + 2^101 - 2^14 - 1 // https://eprint.iacr.org/2017/334
template<class Fp>
struct MapToT {
@@ -527,11 +527,7 @@ struct ParamT {
Fp2::init(cp.xi_a);
b = cp.b;
Fp2 xi(cp.xi_a, 1);
- if (cp == CurveFp462) {
- b_div_xi = xi * b;
- } else {
- b_div_xi = Fp2(b) / xi;
- }
+ b_div_xi = Fp2(b) / xi;
is_b_div_xi_1_m1i = b_div_xi == Fp2(1, -1);
G1::init(0, b, mcl::ec::Proj);
G2::init(0, b_div_xi, mcl::ec::Proj);