aboutsummaryrefslogtreecommitdiffstats
path: root/include/bls.hpp
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-01-20 16:55:49 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-01-20 16:55:49 +0800
commit7de669d11d01a7e15957a6a73bb6f8a2f0f6cd97 (patch)
treeaf75e5b44299545501a9dc2fa61637f9ca335af9 /include/bls.hpp
parentb680d8e089cd81f95c458f2c24f003cc36783c5a (diff)
downloaddexon-bls-7de669d11d01a7e15957a6a73bb6f8a2f0f6cd97.tar
dexon-bls-7de669d11d01a7e15957a6a73bb6f8a2f0f6cd97.tar.gz
dexon-bls-7de669d11d01a7e15957a6a73bb6f8a2f0f6cd97.tar.bz2
dexon-bls-7de669d11d01a7e15957a6a73bb6f8a2f0f6cd97.tar.lz
dexon-bls-7de669d11d01a7e15957a6a73bb6f8a2f0f6cd97.tar.xz
dexon-bls-7de669d11d01a7e15957a6a73bb6f8a2f0f6cd97.tar.zst
dexon-bls-7de669d11d01a7e15957a6a73bb6f8a2f0f6cd97.zip
refactor recover()
Diffstat (limited to 'include/bls.hpp')
-rw-r--r--include/bls.hpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/include/bls.hpp b/include/bls.hpp
index d9ad086..cf4ea23 100644
--- a/include/bls.hpp
+++ b/include/bls.hpp
@@ -60,8 +60,6 @@ class Id {
uint64_t self_[4]; // 256-bit
friend class PublicKey;
friend class SecretKey;
- template<class T, class G> friend struct Wrap;
- template<class T, class G> friend struct WrapPointer;
template<class T, class G> friend struct WrapArray;
impl::Id& getInner() { return *reinterpret_cast<impl::Id*>(self_); }
const impl::Id& getInner() const { return *reinterpret_cast<const impl::Id*>(self_); }
@@ -85,8 +83,6 @@ public:
*/
class SecretKey {
uint64_t self_[4]; // 256-bit
- template<class T, class G> friend struct Wrap;
- template<class T, class G> friend struct WrapPointer;
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_); }
@@ -119,7 +115,10 @@ public:
/*
set a secret key for id > 0 from msk
*/
- void set(const SecretKeyVec& msk, const Id& id);
+ void set(const SecretKeyVec& msk, const Id& id)
+ {
+ set(msk.data(), msk.size(), id);
+ }
/*
recover secretKey from k secVec
*/
@@ -144,8 +143,6 @@ class PublicKey {
uint64_t self_[4 * 2 * 3]; // 256-bit x 2 x 3
friend class SecretKey;
friend class Sign;
- template<class T, class G> friend struct Wrap;
- template<class T, class G> friend struct WrapPointer;
template<class T, class G> friend struct WrapArray;
impl::PublicKey& getInner() { return *reinterpret_cast<impl::PublicKey*>(self_); }
const impl::PublicKey& getInner() const { return *reinterpret_cast<const impl::PublicKey*>(self_); }
@@ -158,7 +155,10 @@ public:
/*
set public for id from mpk
*/
- void set(const PublicKeyVec& mpk, const Id& id);
+ void set(const PublicKeyVec& mpk, const Id& id)
+ {
+ set(mpk.data(), mpk.size(), id);
+ }
/*
recover publicKey from k pubVec
*/
@@ -179,8 +179,6 @@ public:
class Sign {
uint64_t self_[4 * 3]; // 256-bit x 3
friend class SecretKey;
- template<class T, class G> friend struct Wrap;
- template<class T, class G> friend struct WrapPointer;
template<class T, class G> friend struct WrapArray;
impl::Sign& getInner() { return *reinterpret_cast<impl::Sign*>(self_); }
const impl::Sign& getInner() const { return *reinterpret_cast<const impl::Sign*>(self_); }