diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2016-08-15 16:05:53 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2016-08-15 16:05:53 +0800 |
commit | 6d7a12718ba4bc4784c6c86bfdcb49dc0cac6318 (patch) | |
tree | 3793e48d5db8b8cd8d9238354f4b4467d4cdd7e8 /src | |
parent | d3d6bf8848950be1bafae4b90c8e83085b894d16 (diff) | |
download | dexon-bls-6d7a12718ba4bc4784c6c86bfdcb49dc0cac6318.tar dexon-bls-6d7a12718ba4bc4784c6c86bfdcb49dc0cac6318.tar.gz dexon-bls-6d7a12718ba4bc4784c6c86bfdcb49dc0cac6318.tar.bz2 dexon-bls-6d7a12718ba4bc4784c6c86bfdcb49dc0cac6318.tar.lz dexon-bls-6d7a12718ba4bc4784c6c86bfdcb49dc0cac6318.tar.xz dexon-bls-6d7a12718ba4bc4784c6c86bfdcb49dc0cac6318.tar.zst dexon-bls-6d7a12718ba4bc4784c6c86bfdcb49dc0cac6318.zip |
add operator+()
Diffstat (limited to 'src')
-rw-r--r-- | src/bls.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bls.cpp b/src/bls.cpp index ecbb59e..6bc5fc6 100644 --- a/src/bls.cpp +++ b/src/bls.cpp @@ -236,6 +236,12 @@ void Sign::recover(const std::vector<Sign>& signVec) id_ = 0; } +void Sign::add(const Sign& rhs) +{ + if (id_ != 0 || rhs.id_ != 0) throw cybozu::Exception("bls:Sign:add:bad id") << id_ << rhs.id_; + self_->sHm += rhs.self_->sHm; +} + MasterPublicKey::MasterPublicKey() : self_(new impl::MasterPublicKey()) { @@ -342,6 +348,12 @@ bool PublicKey::isValid(const MasterPublicKey& mpk) const return v == self_->sQ; } +void PublicKey::add(const PublicKey& rhs) +{ + if (id_ != 0 || rhs.id_ != 0) throw cybozu::Exception("bls:PublicKey:add:bad id") << id_ << rhs.id_; + self_->sQ += rhs.self_->sQ; +} + PrivateKey::PrivateKey() : self_(new impl::PrivateKey()) , id_(0) @@ -426,4 +438,10 @@ void PrivateKey::recover(const std::vector<PrivateKey>& prvVec) id_ = 0; } +void PrivateKey::add(const PrivateKey& rhs) +{ + if (id_ != 0 || rhs.id_ != 0) throw cybozu::Exception("bls:PrivateKey:add:bad id") << id_ << rhs.id_; + self_->s += rhs.self_->s; +} + } // bls |