aboutsummaryrefslogtreecommitdiffstats
path: root/src/bls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bls.cpp')
-rw-r--r--src/bls.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bls.cpp b/src/bls.cpp
index 8c6ff4a..8577c95 100644
--- a/src/bls.cpp
+++ b/src/bls.cpp
@@ -152,6 +152,7 @@ struct PublicKey {
BN::pairing(e2, sQ, Hm); // e(sQ, Hm)
return e1 == e2;
}
+ const G2& get() const { return sQ; }
};
struct PrivateKey {
@@ -292,6 +293,14 @@ bool PublicKey::verify(const Sign& sign, const std::string& m) const
return self_->verify(*sign.self_, m);
}
+void PublicKey::recover(const std::vector<PublicKey>& pubVec)
+{
+ G2 sQ;
+ LagrangeInterpolation(sQ, pubVec);
+ self_->sQ = sQ;
+ id_ = 0;
+}
+
PrivateKey::PrivateKey()
: self_(new impl::PrivateKey())
, id_(0)