diff --git a/include/mcl/bls12_381.hpp b/include/mcl/bls12_381.hpp new file mode 100644 index 0000000..316e142 --- /dev/null +++ b/include/mcl/bls12_381.hpp @@ -0,0 +1,15 @@ +#pragma once +/** + @file + @brief preset class for BLS12-381 pairing + @author MITSUNARI Shigeo(@herumi) + @license modified new BSD license + http://opensource.org/licenses/BSD-3-Clause +*/ +#define MCL_MAX_FP_BIT_SIZE 384 +#define MCL_MAX_FR_BIT_SIZE 256 +#include + +namespace mcl { namespace bls12 { +using namespace mcl::bn; +} } diff --git a/test/bls12_test.cpp b/test/bls12_test.cpp index 0aa06ae..2c4d98c 100644 --- a/test/bls12_test.cpp +++ b/test/bls12_test.cpp @@ -3,7 +3,7 @@ #include cybozu::CpuClock clk; #include -#include +#include #include #include @@ -11,7 +11,7 @@ cybozu::CpuClock clk; #define MCL_AVOID_EXCEPTION_TEST #endif -using namespace mcl::bn384; +using namespace mcl::bls12; mcl::fp::Mode g_mode; @@ -65,6 +65,7 @@ const struct TestSet { CYBOZU_TEST_AUTO(size) { CYBOZU_TEST_EQUAL(sizeof(Fp), 48u); + CYBOZU_TEST_EQUAL(sizeof(Fr), 32u); CYBOZU_TEST_EQUAL(sizeof(Fp2), sizeof(Fp) * 2); CYBOZU_TEST_EQUAL(sizeof(Fp6), sizeof(Fp) * 6); CYBOZU_TEST_EQUAL(sizeof(Fp12), sizeof(Fp) * 12);