diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-06-04 08:34:43 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-06-04 08:34:43 +0800 |
commit | acf1c832c65429be7f07d8bae5ce91978f78e75f (patch) | |
tree | bf47fed054a78659281a88fd603c9810550ae1a0 /include/bls | |
parent | 5a38c2e8c9a27555229e9cd61455caf1aa3d8907 (diff) | |
download | dexon-bls-acf1c832c65429be7f07d8bae5ce91978f78e75f.tar dexon-bls-acf1c832c65429be7f07d8bae5ce91978f78e75f.tar.gz dexon-bls-acf1c832c65429be7f07d8bae5ce91978f78e75f.tar.bz2 dexon-bls-acf1c832c65429be7f07d8bae5ce91978f78e75f.tar.lz dexon-bls-acf1c832c65429be7f07d8bae5ce91978f78e75f.tar.xz dexon-bls-acf1c832c65429be7f07d8bae5ce91978f78e75f.tar.zst dexon-bls-acf1c832c65429be7f07d8bae5ce91978f78e75f.zip |
use MBN_.. instead of BLS_
Diffstat (limited to 'include/bls')
-rw-r--r-- | include/bls/bls.h | 17 | ||||
-rw-r--r-- | include/bls/bls.hpp | 16 |
2 files changed, 14 insertions, 19 deletions
diff --git a/include/bls/bls.h b/include/bls/bls.h index e762f2e..cb84147 100644 --- a/include/bls/bls.h +++ b/include/bls/bls.h @@ -6,12 +6,7 @@ @license modified new BSD license http://opensource.org/licenses/BSD-3-Clause */ -#ifndef BLS_FP_UNIT_SIZE - #error "define BLS_FP_UNIT_SIZE 4(or 6)" -#endif - -#include <stdint.h> // for uint64_t, uint8_t -#include <stdlib.h> // for size_t +#include <mcl/bn.h> #ifdef _MSC_VER #ifdef BLS_DLL_EXPORT @@ -19,7 +14,7 @@ #else #define BLS_DLL_API __declspec(dllimport) #ifndef BLS_NO_AUTOLINK - #if BLS_FP_UNIT_SIZE == 4 + #if MBN_FP_UNIT_SIZE == 4 #pragma comment(lib, "bls256.lib") #endif #endif @@ -39,19 +34,19 @@ enum { }; typedef struct { - uint64_t buf[BLS_FP_UNIT_SIZE]; + uint64_t buf[MBN_FP_UNIT_SIZE]; } blsId; typedef struct { - uint64_t buf[BLS_FP_UNIT_SIZE]; + uint64_t buf[MBN_FP_UNIT_SIZE]; } blsSecretKey; typedef struct { - uint64_t buf[BLS_FP_UNIT_SIZE * 2 * 3]; + uint64_t buf[MBN_FP_UNIT_SIZE * 2 * 3]; } blsPublicKey; typedef struct { - uint64_t buf[BLS_FP_UNIT_SIZE * 3]; + uint64_t buf[MBN_FP_UNIT_SIZE * 3]; } blsSignature; /* diff --git a/include/bls/bls.hpp b/include/bls/bls.hpp index 382eba7..1ac58d9 100644 --- a/include/bls/bls.hpp +++ b/include/bls/bls.hpp @@ -6,8 +6,8 @@ @license modified new BSD license http://opensource.org/licenses/BSD-3-Clause */ -#ifndef BLS_FP_UNIT_SIZE - #error "define BLS_FP_UNIT_SIZE 4(or 6)" +#ifndef MBN_FP_UNIT_SIZE + #error "define MBN_FP_UNIT_SIZE 4(or 6)" #endif #include <vector> #include <string> @@ -62,7 +62,7 @@ struct Id; @param maxUnitSize [in] 4 or 6 (specify same value used in compiling for validation) @note init() is not thread safe */ -void init(int curve = CurveFp254BNb, int maxUnitSize = BLS_FP_UNIT_SIZE); +void init(int curve = CurveFp254BNb, int maxUnitSize = MBN_FP_UNIT_SIZE); size_t getOpUnitSize(); void getCurveOrder(std::string& str); void getFieldOrder(std::string& str); @@ -77,7 +77,7 @@ class Id; r = 0x2523648240000001ba344d8000000007ff9f800000000010a10000000000000d sizeof(uint64_t) * keySize byte */ -const size_t keySize = BLS_FP_UNIT_SIZE; +const size_t keySize = MBN_FP_UNIT_SIZE; typedef std::vector<SecretKey> SecretKeyVec; typedef std::vector<PublicKey> PublicKeyVec; @@ -85,7 +85,7 @@ typedef std::vector<Signature> SignatureVec; typedef std::vector<Id> IdVec; class Id { - uint64_t self_[BLS_FP_UNIT_SIZE]; + uint64_t self_[MBN_FP_UNIT_SIZE]; friend class PublicKey; friend class SecretKey; template<class T, class G> friend struct WrapArray; @@ -113,7 +113,7 @@ public: s ; secret key */ class SecretKey { - uint64_t self_[BLS_FP_UNIT_SIZE]; + uint64_t self_[MBN_FP_UNIT_SIZE]; template<class T, class G> friend struct WrapArray; impl::SecretKey& getInner() { return *reinterpret_cast<impl::SecretKey*>(self_); } const impl::SecretKey& getInner() const { return *reinterpret_cast<const impl::SecretKey*>(self_); } @@ -178,7 +178,7 @@ public: sQ ; public key */ class PublicKey { - uint64_t self_[BLS_FP_UNIT_SIZE * 2 * 3]; + uint64_t self_[MBN_FP_UNIT_SIZE * 2 * 3]; friend class SecretKey; friend class Signature; template<class T, class G> friend struct WrapArray; @@ -217,7 +217,7 @@ public: s H(m) ; signature */ class Signature { - uint64_t self_[BLS_FP_UNIT_SIZE * 3]; + uint64_t self_[MBN_FP_UNIT_SIZE * 3]; friend class SecretKey; template<class T, class G> friend struct WrapArray; impl::Signature& getInner() { return *reinterpret_cast<impl::Signature*>(self_); } |