diff options
Diffstat (limited to 'include/bls/bls.hpp')
-rw-r--r-- | include/bls/bls.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/bls/bls.hpp b/include/bls/bls.hpp index 3dbacd7..868e574 100644 --- a/include/bls/bls.hpp +++ b/include/bls/bls.hpp @@ -419,6 +419,18 @@ public: { return verifyHash(pub, h.c_str(), h.size()); } + bool verifyAggregation(const PublicKey *pubVec, const mclBnG1 *g1Vec, size_t n) const + { + return blsVerifyAggregation(&self_, &pubVec[0].self_, g1Vec, n) == 1; + } + bool verifyAggregatedHashes(const PublicKey *pubVec, const void *hVec, size_t sizeofHash, size_t n) const + { + std::vector<mclBnG1> g1Vec(n); + for (size_t i = 0; i < n; i++) { + if (blsG1SetHash(&g1Vec[i], (const char*)hVec + sizeofHash * i, sizeofHash) != 0) throw std::runtime_error("blsG1SetHash"); + } + return verifyAggregation(pubVec, g1Vec.data(), n); + } /* verify self(pop) with pub */ |