Skip to content

Commit

Permalink
Update Chia bls-signature to latest version (#2409)
Browse files Browse the repository at this point in the history
Brings in:
1. Chia-Network/bls-signatures#41
2. Chia-Network/bls-signatures#46
3. A few commits from https://github.com/codablock/bls-signatures are now
   merged into upstream.

This removes the need for manual initialization of the BLS library. This is
now done internally and in a thread-safe way.

Also switch to using tags instead of raw commit hashes. Makes testing
easier and also removes the risk of Github deleting commits due to
cleanup jobs.
  • Loading branch information
codablock authored and UdjinM6 committed Nov 1, 2018
1 parent 51addf9 commit 5e829a3
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 20 deletions.
4 changes: 2 additions & 2 deletions depends/packages/chia_bls.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package=chia_bls
$(package)_version=ef06290c1d92eea79b46af135bcc823b019612a6
$(package)_version=v20181101
# It's actually from https://github.com/Chia-Network/bls-signatures, but we have so many patches atm that it's forked
$(package)_download_path=https://github.com/codablock/bls-signatures/archive
$(package)_file_name=$($(package)_version).tar.gz
$(package)_sha256_hash=1e665359fdb946efce943340a324534f72832ecde97c4ebd4ad189f63e029300
$(package)_sha256_hash=b3ec74a77a7b6795f84b05e051a0824ef8d9e05b04b2993f01040f35689aa87c
$(package)_dependencies=gmp
#$(package)_patches=...TODO (when we switch back to https://github.com/Chia-Network/bls-signatures)

Expand Down
1 change: 0 additions & 1 deletion src/bench/bench_dash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ main(int argc, char** argv)
ECC_Start();
ECCVerifyHandle verifyHandle;

BLSInit();
SetupEnvironment();
fPrintToDebugLog = false; // don't want to write to debug.log file

Expand Down
11 changes: 0 additions & 11 deletions src/bls/bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,3 @@ static void secure_free(void* p)
return get_secure_allocator().deallocate(ptr, n);
}
#endif

bool BLSInit()
{
if (!bls::BLS::Init()) {
return false;
}
#ifndef BUILD_BITCOIN_INTERNAL
bls::BLS::SetSecureAllocator(secure_allocate, secure_free);
#endif
return true;
}
2 changes: 0 additions & 2 deletions src/bls/bls.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,4 @@ typedef std::shared_ptr<BLSPublicKeyVector> BLSPublicKeyVectorPtr;
typedef std::shared_ptr<BLSSecretKeyVector> BLSSecretKeyVectorPtr;
typedef std::shared_ptr<BLSSignatureVector> BLSSignatureVectorPtr;

bool BLSInit();

#endif // DASH_CRYPTO_BLS_H
3 changes: 0 additions & 3 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -852,9 +852,6 @@ bool InitSanityCheck(void)
if (!glibc_sanity_test() || !glibcxx_sanity_test())
return false;

if (!BLSInit())
return false;

return true;
}

Expand Down
1 change: 0 additions & 1 deletion src/test/test_dash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ extern void noui_connect();
BasicTestingSetup::BasicTestingSetup(const std::string& chainName)
{
ECC_Start();
BLSInit();
SetupEnvironment();
SetupNetworking();
InitSignatureCache();
Expand Down

0 comments on commit 5e829a3

Please sign in to comment.