Auto merge of #2335 - str4d:2333-validation-speed, r=str4d

Switch to libsecp256k1-based validation for ECDSA

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6983
- bitcoin/bitcoin#6954

Part of #2333.
This commit is contained in:
Homu
2017-06-17 07:18:25 -07:00
98 changed files with 12371 additions and 2690 deletions

View File

@@ -161,6 +161,7 @@ public:
static CCoinsViewDB *pcoinsdbview = NULL;
static CCoinsViewErrorCatcher *pcoinscatcher = NULL;
static boost::scoped_ptr<ECCVerifyHandle> globalVerifyHandle;
void Interrupt(boost::thread_group& threadGroup)
{
@@ -266,6 +267,7 @@ void Shutdown()
#endif
delete pzcashParams;
pzcashParams = NULL;
globalVerifyHandle.reset();
ECC_Stop();
LogPrintf("%s: done\n", __func__);
}
@@ -661,8 +663,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
bool InitSanityCheck(void)
{
if(!ECC_InitSanityCheck()) {
InitError("OpenSSL appears to lack support for elliptic curve cryptography. For more "
"information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries");
InitError("Elliptic curve cryptography sanity check failure. Aborting.");
return false;
}
if (!glibc_sanity_test() || !glibcxx_sanity_test())
@@ -1044,6 +1045,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
// Initialize elliptic curve code
ECC_Start();
globalVerifyHandle.reset(new ECCVerifyHandle());
// Sanity check
if (!InitSanityCheck())