aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-02-15 09:34:50 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-02-15 09:34:50 +0800
commitef25061d9a40cbd0aeadc5a93e214f26db21cfe4 (patch)
tree5031cb7cf4a32d8ca3c1b16f50ae916cdf28c41b
parent10e1d5e59717ee4bd88f6160f1b1afa9ef7c9aa1 (diff)
downloadtangerine-mcl-ef25061d9a40cbd0aeadc5a93e214f26db21cfe4.tar.gz
tangerine-mcl-ef25061d9a40cbd0aeadc5a93e214f26db21cfe4.tar.zst
tangerine-mcl-ef25061d9a40cbd0aeadc5a93e214f26db21cfe4.zip
rename Tag
-rw-r--r--include/mcl/fp.hpp6
-rw-r--r--sample/bench.cpp3
-rw-r--r--sample/ecdh.cpp6
-rw-r--r--sample/vote.cpp3
-rw-r--r--test/fp_tower_test.cpp4
5 files changed, 9 insertions, 13 deletions
diff --git a/include/mcl/fp.hpp b/include/mcl/fp.hpp
index 545a0b2..4a6ec6c 100644
--- a/include/mcl/fp.hpp
+++ b/include/mcl/fp.hpp
@@ -30,11 +30,11 @@
namespace mcl {
-namespace fp {
-
struct FpTag;
struct ZnTag;
+namespace fp {
+
void arrayToStr(std::string& str, const Unit *x, size_t n, int base, bool withPrefix);
/*
@@ -51,7 +51,7 @@ int64_t getInt64(bool *pb, fp::Block& b, const fp::Op& op);
} // mcl::fp
-template<class tag = fp::FpTag, size_t maxBitSize = MCL_MAX_OP_BIT_SIZE>
+template<class tag = FpTag, size_t maxBitSize = MCL_MAX_OP_BIT_SIZE>
class FpT {
typedef fp::Unit Unit;
static const size_t maxSize = (maxBitSize + fp::UnitBitSize - 1) / fp::UnitBitSize;
diff --git a/sample/bench.cpp b/sample/bench.cpp
index b6e67a2..6aecf19 100644
--- a/sample/bench.cpp
+++ b/sample/bench.cpp
@@ -6,8 +6,7 @@
#include <mcl/ecparam.hpp>
typedef mcl::FpT<> Fp;
-struct tagZn;
-typedef mcl::FpT<tagZn> Zn;
+typedef mcl::FpT<mcl::ZnTag> Zn;
typedef mcl::EcT<Fp> Ec;
const char *getModeStr(mcl::fp::Mode mode)
diff --git a/sample/ecdh.cpp b/sample/ecdh.cpp
index 22b9734..1fb1307 100644
--- a/sample/ecdh.cpp
+++ b/sample/ecdh.cpp
@@ -9,12 +9,10 @@
#include <mcl/ecparam.hpp>
#include <mcl/ec.hpp>
#include <mcl/fp.hpp>
-typedef mcl::FpT<> Fp;
-
-struct ZnTag;
+typedef mcl::FpT<> Fp;
+typedef mcl::FpT<mcl::ZnTag> Zn;
typedef mcl::EcT<Fp> Ec;
-typedef mcl::FpT<ZnTag> Zn;
int main()
{
diff --git a/sample/vote.cpp b/sample/vote.cpp
index af4917b..c2d27bc 100644
--- a/sample/vote.cpp
+++ b/sample/vote.cpp
@@ -17,9 +17,8 @@
#include <mcl/elgamal.hpp>
#include <mcl/ecparam.hpp>
-struct TagZn;
typedef mcl::FpT<> Fp;
-typedef mcl::FpT<TagZn> Zn; // use ZnTag because Zn is different class with Fp
+typedef mcl::FpT<mcl::ZnTag> Zn; // use ZnTag because Zn is different class with Fp
typedef mcl::EcT<Fp> Ec;
typedef mcl::ElgamalT<Ec, Zn> Elgamal;
diff --git a/test/fp_tower_test.cpp b/test/fp_tower_test.cpp
index e76b407..81d6bfd 100644
--- a/test/fp_tower_test.cpp
+++ b/test/fp_tower_test.cpp
@@ -4,8 +4,8 @@
#include <time.h>
#include <mcl/fp.hpp>
#include <mcl/fp_tower.hpp>
-struct FpTag;
-typedef mcl::FpT<FpTag, 256> Fp;
+
+typedef mcl::FpT<mcl::FpTag, 256> Fp;
typedef mcl::BnT<Fp> bn;
typedef bn::Fp2 Fp2;