diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2016-08-27 19:56:04 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2016-08-27 19:56:04 +0800 |
commit | fb67a31a6c7720e9499301127bfe57d5342c1d35 (patch) | |
tree | 89035773f009c5e935c8ddca002ee911d7ab9144 /src | |
parent | ea600930c3e920b75d15fa1bffe3d48d818a294b (diff) | |
download | dexon-bls-fb67a31a6c7720e9499301127bfe57d5342c1d35.tar dexon-bls-fb67a31a6c7720e9499301127bfe57d5342c1d35.tar.gz dexon-bls-fb67a31a6c7720e9499301127bfe57d5342c1d35.tar.bz2 dexon-bls-fb67a31a6c7720e9499301127bfe57d5342c1d35.tar.lz dexon-bls-fb67a31a6c7720e9499301127bfe57d5342c1d35.tar.xz dexon-bls-fb67a31a6c7720e9499301127bfe57d5342c1d35.tar.zst dexon-bls-fb67a31a6c7720e9499301127bfe57d5342c1d35.zip |
add init ; remove public key from getPop
Diffstat (limited to 'src')
-rw-r--r-- | src/bls.cpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/src/bls.cpp b/src/bls.cpp index 40599af..87a78f4 100644 --- a/src/bls.cpp +++ b/src/bls.cpp @@ -183,7 +183,7 @@ struct SecretKey { void init(const uint64_t *p) { if (p) { - s.setArray(p, keySize); + s.setArrayMask(p, keySize); } else { s.setRand(getRG()); } @@ -388,8 +388,10 @@ void SecretKey::sign(Sign& sign, const std::string& m) const sign.id_ = id_; } -void SecretKey::getPop(Sign& pop, const PublicKey& pub) const +void SecretKey::getPop(Sign& pop) const { + PublicKey pub; + getPublicKey(pub); std::string m; pub.getStr(m); sign(pop, m); @@ -426,24 +428,5 @@ void SecretKey::add(const SecretKey& rhs) self_->s += rhs.self_->s; } -void getMasterPublicKey(PublicKeyVec& mpk, const SecretKeyVec& msk) -{ - mpk.resize(msk.size()); - for (size_t i = 0; i < msk.size(); i++) { - msk[i].getPublicKey(mpk[i]); - } -} - -void getPopVec(SignVec& popVec, const SecretKeyVec& msk, const PublicKeyVec& mpk) -{ - if (msk.size() != mpk.size()) throw cybozu::Exception("bls:getPopVec:bad size") << msk.size() << mpk.size(); - const size_t n = msk.size(); - popVec.resize(n); - std::string m; - for (size_t i = 0; i < n; i++) { - mpk[i].getStr(m); - msk[i].sign(popVec[i], m); - } -} } // bls |