Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BLS] Add wrapper around chiabls lib, worker, benchmarks and unit tests #2420

Merged
merged 20 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9f9a3d7
Add ctpl header only library
random-zebra Mar 28, 2021
d9ffaa6
Add helper to rename all threads of a ctpl::thread_pool
codablock May 24, 2018
dbb0305
[Trivial] Rename BCLog::BENCH/RAND to BCLog::BENCHMARK/RANDOM
random-zebra Mar 29, 2021
a0b04c1
Add pooled_secure_allocator and mt_pooled_secure_allocator
codablock Jun 2, 2021
6f1d0e2
Implement wrappers around Chia BLS libs
random-zebra Jun 14, 2021
df56dea
Add simple helpers/wrappers for BLS+AES based integrated encryption
codablock May 24, 2018
225c8a8
Add highly parallelized worker/helper for BLS/DKG calculations
codablock May 24, 2018
7bb9f02
[Trivial] bls_worker: Fix members initialization order in Aggregators
random-zebra Jun 14, 2021
9502597
Add BLS and DKG benchmarks
codablock May 24, 2018
1c3f2cb
[Trivial] Remove unused variables in bls bench test
random-zebra Sep 14, 2021
5b16d89
[BUG] Initialize Random for bench tests
random-zebra Mar 29, 2021
f5c0870
Add ECDSA benchmarks
codablock Sep 14, 2018
104c4b0
Bail out early from secure deallocation
codablock Jun 2, 2021
c4c6efe
[Refactor] Initialize BLS allocator in BasicTestingSetup
random-zebra Jun 2, 2021
0253ea7
[QA] Add test for BLS sign/verify message and sethexstr
random-zebra Jun 3, 2021
9f4ac39
[QA] Add unit test for DKG using wrapper/worker
random-zebra Jul 28, 2021
aa51751
[Refactoring] Replace std::random_shuffle with Shuffle
random-zebra Jul 28, 2021
0453474
Test: Add bls ies basic encryption and decryption test coverage.
furszy Sep 6, 2021
db69885
[QA] Refactor bls_ies_tests using CBLSIESEncryptedObject
random-zebra Sep 7, 2021
0d126ee
[QA] Test encryption/decryption of sk shares in dkg unit test
random-zebra Sep 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ set(SERVER_SOURCES
./src/addrman.cpp
./src/bloom.cpp
./src/blocksignature.cpp
./src/bls/bls_ies.cpp
./src/bls/bls_worker.cpp
./src/bls/bls_wrapper.cpp
./src/chain.cpp
./src/checkpoints.cpp
./src/consensus/tx_verify.cpp
Expand Down
9 changes: 9 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ BITCOIN_CORE_H = \
bip38.h \
bloom.h \
blocksignature.h \
bls/bls_ies.h \
bls/bls_worker.h \
bls/bls_wrapper.h \
chain.h \
chainparams.h \
chainparamsbase.h \
Expand Down Expand Up @@ -189,6 +192,7 @@ BITCOIN_CORE_H = \
core_io.h \
cuckoocache.h \
crypter.h \
ctpl.h \
cyclingvector.h \
evo/deterministicmns.h \
evo/evodb.h \
Expand Down Expand Up @@ -275,6 +279,8 @@ BITCOIN_CORE_H = \
stakeinput.h \
script/ismine.h \
streams.h \
support/allocators/mt_pooled_secure.h \
support/allocators/pooled_secure.h \
support/allocators/secure.h \
support/allocators/zeroafterfree.h \
support/cleanse.h \
Expand Down Expand Up @@ -335,6 +341,9 @@ libbitcoin_server_a_SOURCES = \
addrman.cpp \
bloom.cpp \
blocksignature.cpp \
bls/bls_ies.cpp \
bls/bls_worker.cpp \
bls/bls_wrapper.cpp \
chain.cpp \
checkpoints.cpp \
consensus/params.cpp \
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile.bench.include
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ bench_bench_pivx_SOURCES = \
bench/bench.h \
bench/Examples.cpp \
bench/base58.cpp \
bench/bls.cpp \
bench/bls_dkg.cpp \
bench/checkblock.cpp \
bench/checkqueue.cpp \
bench/data.h \
bench/data.cpp \
bench/chacha20.cpp \
bench/crypto_hash.cpp \
bench/ecdsa.cpp \
bench/lockedpool.cpp \
bench/perf.cpp \
bench/perf.h \
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ BITCOIN_TESTS =\
test/base64_tests.cpp \
test/bech32_tests.cpp \
test/bip32_tests.cpp \
test/bls_tests.cpp \
test/budget_tests.cpp \
test/checkblock_tests.cpp \
test/Checkpoints_tests.cpp \
Expand Down
17 changes: 15 additions & 2 deletions src/bench/bench_pivx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,30 @@

#include "bench.h"

#include "bls/bls_wrapper.h"
#include "key.h"
#include "random.h"
#include "util/system.h"

int
main(int argc, char** argv)
void InitBLSTests();
void CleanupBLSTests();
void CleanupBLSDkgTests();

int main(int argc, char** argv)
{
ECC_Start();
ECCVerifyHandle globalVerifyHandle;
RandomInit();
BLSInit();
InitBLSTests();
SetupEnvironment();
g_logger->m_print_to_file = false; // don't want to write to debug.log file

benchmark::BenchRunner::RunAll();

// need to be called before global destructors kick in (PoolAllocator is needed due to many BLSSecretKeys)
CleanupBLSDkgTests();
CleanupBLSTests();

ECC_Stop();
}
Loading