aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2019-03-12 17:04:56 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2019-03-12 17:04:56 +0800
commit4ae8bc289c2dde29445cf66621c6c97f8e4fba85 (patch)
tree92e6a7676a5f583253b2519b2b5c5f568cef574b
parent497fa07d29b247b89310c5369c8fe3490246806a (diff)
downloadtangerine-mcl-4ae8bc289c2dde29445cf66621c6c97f8e4fba85.tar.gz
tangerine-mcl-4ae8bc289c2dde29445cf66621c6c97f8e4fba85.tar.zst
tangerine-mcl-4ae8bc289c2dde29445cf66621c6c97f8e4fba85.zip
add version
-rw-r--r--include/mcl/bn.h2
-rw-r--r--include/mcl/impl/bn_c_impl.hpp5
-rw-r--r--include/mcl/op.hpp2
-rw-r--r--readme.md1
-rw-r--r--test/bn_test.cpp1
5 files changed, 11 insertions, 0 deletions
diff --git a/include/mcl/bn.h b/include/mcl/bn.h
index 589798f..0a31d55 100644
--- a/include/mcl/bn.h
+++ b/include/mcl/bn.h
@@ -112,6 +112,8 @@ enum {
mclBls12_CurveFp381 = 5
};
+// return 0xABC which means A.BC
+MCLBN_DLL_API int mclBn_getVersion();
/*
init library
@param curve [in] type of bn curve
diff --git a/include/mcl/impl/bn_c_impl.hpp b/include/mcl/impl/bn_c_impl.hpp
index 1852668..bec2466 100644
--- a/include/mcl/impl/bn_c_impl.hpp
+++ b/include/mcl/impl/bn_c_impl.hpp
@@ -60,6 +60,11 @@ extern "C" MCLBN_DLL_API void mclBnFree(void *p)
}
#endif
+int mclBn_getVersion()
+{
+ return mcl::version;
+}
+
int mclBn_init(int curve, int compiledTimeVar)
{
if (compiledTimeVar != MCLBN_COMPILED_TIME_VAR) {
diff --git a/include/mcl/op.hpp b/include/mcl/op.hpp
index 155d168..393319a 100644
--- a/include/mcl/op.hpp
+++ b/include/mcl/op.hpp
@@ -26,6 +26,8 @@
namespace mcl {
+static const int version = 0x090; /* 0xABC = A.BC */
+
/*
specifies available string format mode for X::setIoMode()
// for Fp, Fp2, Fp6, Fp12
diff --git a/readme.md b/readme.md
index 6e376ab..f3d3f65 100644
--- a/readme.md
+++ b/readme.md
@@ -443,6 +443,7 @@ Y. Sakemi, Y. Nogami, K. Okeya, Y. Morikawa, CANS 2008.
# History
+* 2019/Mar/12 v0.90 fix Vint::setArray(x) for x == this
* 2019/Mar/07 add mclBnFr_setLittleEndianMod, mclBnFp_setLittleEndianMod
* 2019/Feb/20 LagrangeInterpolation sets out = yVec[0] if k = 1
* 2019/Jan/31 add mclBnFp_mapToG1, mclBnFp2_mapToG2
diff --git a/test/bn_test.cpp b/test/bn_test.cpp
index 52a48d6..071ec70 100644
--- a/test/bn_test.cpp
+++ b/test/bn_test.cpp
@@ -352,6 +352,7 @@ void testIo(const G1& P, const G2& Q)
CYBOZU_TEST_AUTO(naive)
{
+ printf("mcl version=%03x\n", mcl::version);
for (size_t i = 0; i < CYBOZU_NUM_OF_ARRAY(g_testSetTbl); i++) {
const TestSet& ts = g_testSetTbl[i];
printf("i=%d curve=%s\n", int(i), ts.name);