![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
#include <bls_worker.h>
Classes | |
| struct | SigVerifyJob |
Public Types | |
| typedef std::function< void(const CBLSSignature &)> | SignDoneCallback |
| typedef std::function< void(bool)> | SigVerifyDoneCallback |
| typedef std::function< bool()> | CancelCond |
Public Member Functions | |
| CBLSWorker () | |
| ~CBLSWorker () | |
| void | Start () |
| void | Stop () |
| bool | GenerateContributions (int threshold, const BLSIdVector &ids, BLSVerificationVectorPtr &vvecRet, BLSSecretKeyVector &skShares) |
| void | AsyncBuildQuorumVerificationVector (const std::vector< BLSVerificationVectorPtr > &vvecs, size_t start, size_t count, bool parallel, std::function< void(const BLSVerificationVectorPtr &)> doneCallback) |
| std::future< BLSVerificationVectorPtr > | AsyncBuildQuorumVerificationVector (const std::vector< BLSVerificationVectorPtr > &vvecs, size_t start, size_t count, bool parallel) |
| BLSVerificationVectorPtr | BuildQuorumVerificationVector (const std::vector< BLSVerificationVectorPtr > &vvecs, size_t start=0, size_t count=0, bool parallel=true) |
| void | AsyncAggregateSecretKeys (const BLSSecretKeyVector &secKeys, size_t start, size_t count, bool parallel, std::function< void(const CBLSSecretKey &)> doneCallback) |
| std::future< CBLSSecretKey > | AsyncAggregateSecretKeys (const BLSSecretKeyVector &secKeys, size_t start, size_t count, bool parallel) |
| CBLSSecretKey | AggregateSecretKeys (const BLSSecretKeyVector &secKeys, size_t start=0, size_t count=0, bool parallel=true) |
| void | AsyncAggregatePublicKeys (const BLSPublicKeyVector &pubKeys, size_t start, size_t count, bool parallel, std::function< void(const CBLSPublicKey &)> doneCallback) |
| std::future< CBLSPublicKey > | AsyncAggregatePublicKeys (const BLSPublicKeyVector &pubKeys, size_t start, size_t count, bool parallel) |
| CBLSPublicKey | AggregatePublicKeys (const BLSPublicKeyVector &pubKeys, size_t start=0, size_t count=0, bool parallel=true) |
| void | AsyncAggregateSigs (const BLSSignatureVector &sigs, size_t start, size_t count, bool parallel, std::function< void(const CBLSSignature &)> doneCallback) |
| std::future< CBLSSignature > | AsyncAggregateSigs (const BLSSignatureVector &sigs, size_t start, size_t count, bool parallel) |
| CBLSSignature | AggregateSigs (const BLSSignatureVector &sigs, size_t start=0, size_t count=0, bool parallel=true) |
| CBLSPublicKey | BuildPubKeyShare (const BLSVerificationVectorPtr &vvec, const CBLSId &id) |
| void | AsyncVerifyContributionShares (const CBLSId &forId, const std::vector< BLSVerificationVectorPtr > &vvecs, const BLSSecretKeyVector &skShares, bool parallel, bool aggregated, std::function< void(const std::vector< bool > &)> doneCallback) |
| std::future< std::vector< bool > > | AsyncVerifyContributionShares (const CBLSId &forId, const std::vector< BLSVerificationVectorPtr > &vvecs, const BLSSecretKeyVector &skShares, bool parallel, bool aggregated) |
| std::vector< bool > | VerifyContributionShares (const CBLSId &forId, const std::vector< BLSVerificationVectorPtr > &vvecs, const BLSSecretKeyVector &skShares, bool parallel=true, bool aggregated=true) |
| std::future< bool > | AsyncVerifyContributionShare (const CBLSId &forId, const BLSVerificationVectorPtr &vvec, const CBLSSecretKey &skContribution) |
| bool | VerifyContributionShare (const CBLSId &forId, const BLSVerificationVectorPtr &vvec, const CBLSSecretKey &skContribution) |
| bool | VerifyVerificationVector (const BLSVerificationVector &vvec, size_t start=0, size_t count=0) |
| bool | VerifyVerificationVectors (const std::vector< BLSVerificationVectorPtr > &vvecs, size_t start=0, size_t count=0) |
| bool | VerifySecretKeyVector (const BLSSecretKeyVector &secKeys, size_t start=0, size_t count=0) |
| bool | VerifySignatureVector (const BLSSignatureVector &sigs, size_t start=0, size_t count=0) |
| void | AsyncSign (const CBLSSecretKey &secKey, const uint256 &msgHash, SignDoneCallback doneCallback) |
| std::future< CBLSSignature > | AsyncSign (const CBLSSecretKey &secKey, const uint256 &msgHash) |
| void | AsyncVerifySig (const CBLSSignature &sig, const CBLSPublicKey &pubKey, const uint256 &msgHash, SigVerifyDoneCallback doneCallback, CancelCond cancelCond=[] { return false;}) |
| std::future< bool > | AsyncVerifySig (const CBLSSignature &sig, const CBLSPublicKey &pubKey, const uint256 &msgHash, CancelCond cancelCond=[] { return false;}) |
| bool | IsAsyncVerifyInProgress () |
Private Member Functions | |
| void | PushSigVerifyBatch () |
Private Attributes | |
| ctpl::thread_pool | workerPool |
| std::mutex | sigVerifyMutex |
| int | sigVerifyBatchesInProgress {0} |
| std::vector< SigVerifyJob > | sigVerifyQueue |
Static Private Attributes | |
| static const int | SIG_VERIFY_BATCH_SIZE = 8 |
Definition at line 19 of file bls_worker.h.
| typedef std::function<bool()> CBLSWorker::CancelCond |
Definition at line 24 of file bls_worker.h.
| typedef std::function<void(const CBLSSignature&)> CBLSWorker::SignDoneCallback |
Definition at line 22 of file bls_worker.h.
| typedef std::function<void(bool)> CBLSWorker::SigVerifyDoneCallback |
Definition at line 23 of file bls_worker.h.
| CBLSWorker::CBLSWorker | ( | ) |
Definition at line 54 of file bls_worker.cpp.
| CBLSWorker::~CBLSWorker | ( | ) |
| CBLSPublicKey CBLSWorker::AggregatePublicKeys | ( | const BLSPublicKeyVector & | pubKeys, |
| size_t | start = 0, |
||
| size_t | count = 0, |
||
| bool | parallel = true |
||
| ) |
Definition at line 696 of file bls_worker.cpp.
| CBLSSecretKey CBLSWorker::AggregateSecretKeys | ( | const BLSSecretKeyVector & | secKeys, |
| size_t | start = 0, |
||
| size_t | count = 0, |
||
| bool | parallel = true |
||
| ) |
| CBLSSignature CBLSWorker::AggregateSigs | ( | const BLSSignatureVector & | sigs, |
| size_t | start = 0, |
||
| size_t | count = 0, |
||
| bool | parallel = true |
||
| ) |
Definition at line 717 of file bls_worker.cpp.
| std::future< CBLSPublicKey > CBLSWorker::AsyncAggregatePublicKeys | ( | const BLSPublicKeyVector & | pubKeys, |
| size_t | start, | ||
| size_t | count, | ||
| bool | parallel | ||
| ) |
Definition at line 688 of file bls_worker.cpp.
| void CBLSWorker::AsyncAggregatePublicKeys | ( | const BLSPublicKeyVector & | pubKeys, |
| size_t | start, | ||
| size_t | count, | ||
| bool | parallel, | ||
| std::function< void(const CBLSPublicKey &)> | doneCallback | ||
| ) |
Definition at line 681 of file bls_worker.cpp.
| std::future< CBLSSecretKey > CBLSWorker::AsyncAggregateSecretKeys | ( | const BLSSecretKeyVector & | secKeys, |
| size_t | start, | ||
| size_t | count, | ||
| bool | parallel | ||
| ) |
Definition at line 667 of file bls_worker.cpp.
| void CBLSWorker::AsyncAggregateSecretKeys | ( | const BLSSecretKeyVector & | secKeys, |
| size_t | start, | ||
| size_t | count, | ||
| bool | parallel, | ||
| std::function< void(const CBLSSecretKey &)> | doneCallback | ||
| ) |
Definition at line 660 of file bls_worker.cpp.
| std::future< CBLSSignature > CBLSWorker::AsyncAggregateSigs | ( | const BLSSignatureVector & | sigs, |
| size_t | start, | ||
| size_t | count, | ||
| bool | parallel | ||
| ) |
Definition at line 709 of file bls_worker.cpp.
| void CBLSWorker::AsyncAggregateSigs | ( | const BLSSignatureVector & | sigs, |
| size_t | start, | ||
| size_t | count, | ||
| bool | parallel, | ||
| std::function< void(const CBLSSignature &)> | doneCallback | ||
| ) |
Definition at line 702 of file bls_worker.cpp.
| std::future< BLSVerificationVectorPtr > CBLSWorker::AsyncBuildQuorumVerificationVector | ( | const std::vector< BLSVerificationVectorPtr > & | vvecs, |
| size_t | start, | ||
| size_t | count, | ||
| bool | parallel | ||
| ) |
Definition at line 625 of file bls_worker.cpp.
| void CBLSWorker::AsyncBuildQuorumVerificationVector | ( | const std::vector< BLSVerificationVectorPtr > & | vvecs, |
| size_t | start, | ||
| size_t | count, | ||
| bool | parallel, | ||
| std::function< void(const BLSVerificationVectorPtr &)> | doneCallback | ||
| ) |
Definition at line 605 of file bls_worker.cpp.
| std::future< CBLSSignature > CBLSWorker::AsyncSign | ( | const CBLSSecretKey & | secKey, |
| const uint256 & | msgHash | ||
| ) |
| void CBLSWorker::AsyncSign | ( | const CBLSSecretKey & | secKey, |
| const uint256 & | msgHash, | ||
| CBLSWorker::SignDoneCallback | doneCallback | ||
| ) |
Definition at line 832 of file bls_worker.cpp.
| std::future< bool > CBLSWorker::AsyncVerifyContributionShare | ( | const CBLSId & | forId, |
| const BLSVerificationVectorPtr & | vvec, | ||
| const CBLSSecretKey & | skContribution | ||
| ) |
Definition at line 759 of file bls_worker.cpp.
| std::future< std::vector< bool > > CBLSWorker::AsyncVerifyContributionShares | ( | const CBLSId & | forId, |
| const std::vector< BLSVerificationVectorPtr > & | vvecs, | ||
| const BLSSecretKeyVector & | skShares, | ||
| bool | parallel, | ||
| bool | aggregated | ||
| ) |
| void CBLSWorker::AsyncVerifyContributionShares | ( | const CBLSId & | forId, |
| const std::vector< BLSVerificationVectorPtr > & | vvecs, | ||
| const BLSSecretKeyVector & | skShares, | ||
| bool | parallel, | ||
| bool | aggregated, | ||
| std::function< void(const std::vector< bool > &)> | doneCallback | ||
| ) |
Definition at line 731 of file bls_worker.cpp.
| std::future< bool > CBLSWorker::AsyncVerifySig | ( | const CBLSSignature & | sig, |
| const CBLSPublicKey & | pubKey, | ||
| const uint256 & | msgHash, | ||
| CancelCond | cancelCond = [] { return false; } |
||
| ) |
| void CBLSWorker::AsyncVerifySig | ( | const CBLSSignature & | sig, |
| const CBLSPublicKey & | pubKey, | ||
| const uint256 & | msgHash, | ||
| CBLSWorker::SigVerifyDoneCallback | doneCallback, | ||
| CancelCond | cancelCond = [] { return false; } |
||
| ) |
Definition at line 846 of file bls_worker.cpp.
| CBLSPublicKey CBLSWorker::BuildPubKeyShare | ( | const BLSVerificationVectorPtr & | vvec, |
| const CBLSId & | id | ||
| ) |
Definition at line 724 of file bls_worker.cpp.
| BLSVerificationVectorPtr CBLSWorker::BuildQuorumVerificationVector | ( | const std::vector< BLSVerificationVectorPtr > & | vvecs, |
| size_t | start = 0, |
||
| size_t | count = 0, |
||
| bool | parallel = true |
||
| ) |
| bool CBLSWorker::GenerateContributions | ( | int | threshold, |
| const BLSIdVector & | ids, | ||
| BLSVerificationVectorPtr & | vvecRet, | ||
| BLSSecretKeyVector & | skShares | ||
| ) |
| bool CBLSWorker::IsAsyncVerifyInProgress | ( | ) |
Definition at line 883 of file bls_worker.cpp.
|
private |
Definition at line 890 of file bls_worker.cpp.
| void CBLSWorker::Start | ( | ) |
Definition at line 63 of file bls_worker.cpp.
| void CBLSWorker::Stop | ( | ) |
Definition at line 71 of file bls_worker.cpp.
| bool CBLSWorker::VerifyContributionShare | ( | const CBLSId & | forId, |
| const BLSVerificationVectorPtr & | vvec, | ||
| const CBLSSecretKey & | skContribution | ||
| ) |
Definition at line 775 of file bls_worker.cpp.
| std::vector< bool > CBLSWorker::VerifyContributionShares | ( | const CBLSId & | forId, |
| const std::vector< BLSVerificationVectorPtr > & | vvecs, | ||
| const BLSSecretKeyVector & | skShares, | ||
| bool | parallel = true, |
||
| bool | aggregated = true |
||
| ) |
Definition at line 753 of file bls_worker.cpp.
| bool CBLSWorker::VerifySecretKeyVector | ( | const BLSSecretKeyVector & | secKeys, |
| size_t | start = 0, |
||
| size_t | count = 0 |
||
| ) |
Definition at line 822 of file bls_worker.cpp.
| bool CBLSWorker::VerifySignatureVector | ( | const BLSSignatureVector & | sigs, |
| size_t | start = 0, |
||
| size_t | count = 0 |
||
| ) |
Definition at line 827 of file bls_worker.cpp.
| bool CBLSWorker::VerifyVerificationVector | ( | const BLSVerificationVector & | vvec, |
| size_t | start = 0, |
||
| size_t | count = 0 |
||
| ) |
| bool CBLSWorker::VerifyVerificationVectors | ( | const std::vector< BLSVerificationVectorPtr > & | vvecs, |
| size_t | start = 0, |
||
| size_t | count = 0 |
||
| ) |
|
staticprivate |
Definition at line 29 of file bls_worker.h.
|
private |
Definition at line 47 of file bls_worker.h.
|
private |
Definition at line 46 of file bls_worker.h.
|
private |
Definition at line 48 of file bls_worker.h.
|
private |
Definition at line 27 of file bls_worker.h.