aboutsummaryrefslogtreecommitdiffstats
path: root/include/bls.hpp
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-08-21 14:56:11 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-08-21 14:56:11 +0800
commitc168821535428ebfedafb72fd9e70b36cff9f938 (patch)
treec24fdb1aad9fcd31c0d4c9edfd033ca0f08dece1 /include/bls.hpp
parenta90c968b55d975bc0e958631892d1a1799ae97d5 (diff)
downloaddexon-bls-c168821535428ebfedafb72fd9e70b36cff9f938.tar
dexon-bls-c168821535428ebfedafb72fd9e70b36cff9f938.tar.gz
dexon-bls-c168821535428ebfedafb72fd9e70b36cff9f938.tar.bz2
dexon-bls-c168821535428ebfedafb72fd9e70b36cff9f938.tar.lz
dexon-bls-c168821535428ebfedafb72fd9e70b36cff9f938.tar.xz
dexon-bls-c168821535428ebfedafb72fd9e70b36cff9f938.tar.zst
dexon-bls-c168821535428ebfedafb72fd9e70b36cff9f938.zip
unify **Vec
Diffstat (limited to 'include/bls.hpp')
-rw-r--r--include/bls.hpp27
1 files changed, 8 insertions, 19 deletions
diff --git a/include/bls.hpp b/include/bls.hpp
index 7cfeed8..8a51488 100644
--- a/include/bls.hpp
+++ b/include/bls.hpp
@@ -45,17 +45,6 @@ typedef std::vector<Sign> SignVec;
typedef std::vector<PublicKey> PublicKeyVec;
typedef std::vector<SecretKey> SecretKeyVec;
-/*
- [s_0, s_1, ..., s_{k-1}]
- s_0 is original private key
-*/
-typedef std::vector<SecretKey> MasterSecretKey;
-/*
- [s_0 Q, ..., s_{k-1} Q]
- Q is global fixed parameter
-*/
-typedef std::vector<PublicKey> MasterPublicKey;
-
class Sign {
impl::Sign *self_;
int id_;
@@ -81,7 +70,7 @@ public:
/*
recover sign from k signVec
*/
- void recover(const std::vector<Sign>& signVec);
+ void recover(const SignVec& signVec);
/*
add signature key only if id_ == 0
*/
@@ -114,11 +103,11 @@ public:
/*
set public for id from mpk
*/
- void set(const MasterPublicKey& mpk, int id);
+ void set(const PublicKeyVec& mpk, int id);
/*
recover publicKey from k pubVec
*/
- void recover(const std::vector<PublicKey>& pubVec);
+ void recover(const PublicKeyVec& pubVec);
/*
add public key only if id_ == 0
*/
@@ -158,15 +147,15 @@ public:
/*
make [s_0, ..., s_{k-1}] to prepare k-out-of-n secret sharing
*/
- void getMasterSecretKey(MasterSecretKey& msk, int k) const;
+ void getMasterSecretKey(SecretKeyVec& msk, int k) const;
/*
set a private key for id > 0 from msk
*/
- void set(const MasterSecretKey& msk, int id);
+ void set(const SecretKeyVec& msk, int id);
/*
recover secretKey from k secVec
*/
- void recover(const std::vector<SecretKey>& secVec);
+ void recover(const SecretKeyVec& secVec);
/*
add private key only if id_ == 0
*/
@@ -176,12 +165,12 @@ public:
/*
make master public key [s_0 Q, ..., s_{k-1} Q] from msk
*/
-void getMasterPublicKey(MasterPublicKey& mpk, const MasterSecretKey& msk);
+void getMasterPublicKey(PublicKeyVec& mpk, const SecretKeyVec& msk);
/*
make pop from msk and mpk
*/
-void getPopVec(std::vector<Sign>& popVec, const MasterSecretKey& msk, const MasterPublicKey& mpk);
+void getPopVec(SignVec& popVec, const SecretKeyVec& msk, const PublicKeyVec& mpk);
inline Sign operator+(const Sign& a, const Sign& b) { Sign r(a); r.add(b); return r; }
inline PublicKey operator+(const PublicKey& a, const PublicKey& b) { PublicKey r(a); r.add(b); return r; }