-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add an experimental batch module #1134
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
Open
siv2r
wants to merge
9
commits into
bitcoin-core:master
Choose a base branch
from
siv2r:batch-verify-interface
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
800233a
batch: Initialize an experimental batch module
siv2r 535a94b
batch: Add create and destroy APIs
siv2r b47d8f3
batch, ecmult: Add batch_verify and refactor strauss_batch
siv2r f818fc0
batch: Add batch_add_* APIs
siv2r e5bbca6
batch: Add example
siv2r 6378b6b
batch,ecmult: Add tests for core batch APIs and strauss_batch refactor
siv2r 642901f
batch: Add tests for batch_add_* APIs
siv2r e5df505
batch, extrakeys: Add benchmarks
siv2r 410abb2
batch: Generate speedup graphs
siv2r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ ecdsa_example | |
schnorr_example | ||
ellswift_example | ||
musig_example | ||
batch_example | ||
*.exe | ||
*.so | ||
*.a | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ print_environment() { | |
# does not rely on bash. | ||
for var in WERROR_CFLAGS MAKEFLAGS BUILD \ | ||
ECMULTWINDOW ECMULTGENKB ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \ | ||
EXPERIMENTAL ECDH RECOVERY EXTRAKEYS MUSIG SCHNORRSIG ELLSWIFT \ | ||
EXPERIMENTAL ECDH RECOVERY EXTRAKEYS MUSIG SCHNORRSIG ELLSWIFT BATCH \ | ||
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS SYMBOL_CHECK \ | ||
EXAMPLES \ | ||
HOST WRAPPER_CMD \ | ||
|
@@ -80,6 +80,7 @@ esac | |
--enable-module-extrakeys="$EXTRAKEYS" \ | ||
--enable-module-schnorrsig="$SCHNORRSIG" \ | ||
--enable-module-musig="$MUSIG" \ | ||
--enable-module-batch="$BATCH" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
--enable-examples="$EXAMPLES" \ | ||
--enable-ctime-tests="$CTIMETESTS" \ | ||
--with-valgrind="$WITH_VALGRIND" \ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Schnorrsig Batch Verification Speedup | ||
|
||
 | ||
|
||
# Tweak Pubkey Check Batch Verification Speedup | ||
|
||
 | ||
|
||
Build steps | ||
----------- | ||
To generate the above graphs on your local machine: | ||
|
||
$ cd doc/speedup-batch | ||
$ make | ||
$ make speedup-batch.png | ||
|
||
<!-- TODO: add additional notes on the API --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.dat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
schnorrsig_data = schnorrsig_batch.dat schnorrsig_single.dat | ||
tweak_data = tweak_batch.dat tweak_single.dat | ||
|
||
bench_output.txt: bench.sh | ||
SECP256K1_BENCH_ITERS=500000 ./bench.sh bench_output.txt | ||
|
||
schnorrsig_batch.dat: bench_output.txt | ||
cat bench_output.txt | grep -v "batchverify_schnorrsigs_1 " | awk '{ gsub(/ /,""); print }' | gawk -F, 'match($$0, /batchverify_schnorrsigs_([0-9]+)/, arr) {print arr[1] " " $$3}' > schnorrsig_batch.dat | ||
|
||
schnorrsig_single.dat: bench_output.txt | ||
cat bench_output.txt | awk '{ gsub(/ /,""); print }' | awk -F, 'match($$0, /schnorrsig_verify/) {print $$3}' > schnorrsig_single.dat | ||
|
||
tweak_batch.dat: bench_output.txt | ||
cat bench_output.txt | grep -v "batchverify_tweak_checks_1 " | awk '{ gsub(/ /,""); print }' | gawk -F, 'match($$0, /batchverify_tweak_checks_([0-9]+)/, arr) {print arr[1] " " $$3}' > tweak_batch.dat | ||
|
||
tweak_single.dat: bench_output.txt | ||
cat bench_output.txt | awk '{ gsub(/ /,""); print }' | awk -F, 'match($$0, /tweak_add_check/) {print $$3}' > tweak_single.dat | ||
|
||
speedup-batch.png: $(schnorrsig_data) $(tweak_data) plot.gp | ||
gnuplot plot.gp | ||
|
||
clean: | ||
rm *.log *.txt *.dat *.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
output_file=$1 | ||
cur_dir=$(pwd) | ||
|
||
cd ../../ | ||
echo "HEAD: $(git rev-parse --short HEAD)" > "$cur_dir/$output_file.log" | ||
make clean | ||
./autogen.sh | ||
./configure --enable-experimental --enable-module-batch --enable-module-schnorrsig >> "$cur_dir/$output_file.log" | ||
make | ||
./bench schnorrsig > "$cur_dir/$output_file" | ||
./bench extrakeys >> "$cur_dir/$output_file" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also mention "according to BIP340" here since batch verification is also specified there.