Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
270f6c8
Portability fix for the configure scripts generated
khorben Feb 26, 2018
cddef0c
tests: add warning message when /dev/urandom fails
hdon Mar 6, 2018
8b3841c
fix bug in fread() failure check
hdon Mar 6, 2018
0f05173
Fix algorithm selection in bench_ecmult
jonasnick Feb 23, 2018
3965027
Summarize build options in configure script
eklitzke Mar 10, 2018
4efb3f8
Add check that restrict pointers don't alias with all parameters.
roconnor-blockstream Jul 6, 2018
deff5ed
Correct math typos in field_*.h
roconnor-blockstream Jul 6, 2018
52ab96f
clean dependendies in field_*_impl.h
roconnor-blockstream Jul 6, 2018
9bd89c8
Optimize secp256k1_fe_normalize_weak calls.
roconnor-blockstream Aug 13, 2018
bf8b86c
secp256k1_fe_sqrt: Verify that the arguments don't alias.
roconnor-blockstream Aug 14, 2018
496c5b4
Make constants static:
roconnor-blockstream Aug 15, 2018
d3cb1f9
Make use of TAG_PUBKEY constants in secp256k1_eckey_pubkey_parse
Empact Oct 9, 2018
89a20a8
Correct order of libs returned on pkg-config --libs --static libsecp2…
pmienk Oct 23, 2018
3cb057f
Fix possible integer overflow in DER parsing
real-or-random Nov 1, 2018
c663397
Use __GNUC_PREREQ for detecting __builtin_expect
real-or-random Dec 17, 2018
6198375
Make randomization of a non-signing context a noop
real-or-random Jan 27, 2019
b408c6a
Merge #579: Use __GNUC_PREREQ for detecting __builtin_expect
sipa Feb 4, 2019
2d5f4ce
configure: Use CFLAGS_FOR_BUILD when checking native compiler
real-or-random Jan 16, 2019
a34bcaa
Actually pass CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD to linker
real-or-random Feb 10, 2019
949e85b
Merge #550: Optimize secp256k1_fe_normalize_weak calls.
gmaxwell Feb 21, 2019
ba698f8
Merge #539: Assorted minor corrections
gmaxwell Feb 21, 2019
1c131af
Merge #551: secp256k1_fe_sqrt: Verify that the arguments don't alias.
gmaxwell Feb 21, 2019
2ebdad7
Merge #552: Make constants static:
gmaxwell Feb 21, 2019
58df8d0
Merge #511: Portability fix for the configure scripts generated
gmaxwell Feb 21, 2019
e96901a
Merge #587: Make randomization of a non-signing context a noop
gmaxwell Feb 21, 2019
0e9ada1
Merge #567: Correct order of libs returned on pkg-config --libs --sta…
gmaxwell Feb 21, 2019
6492bf8
Merge #518: Summarize build options after running configure
gmaxwell Feb 21, 2019
c71dd2c
Merge #509: Fix algorithm selection in bench_ecmult
gmaxwell Feb 21, 2019
be40c4d
Fixup for C90 mixed declarations.
gmaxwell Feb 21, 2019
870a977
Merge #562: Make use of TAG_PUBKEY constants in secp256k1_eckey_pubke…
gmaxwell Feb 21, 2019
b76e45d
Make bench_internal obey secp256k1_fe_sqrt's contract wrt aliasing.
gmaxwell Feb 21, 2019
20c5869
Merge #516: improvements to random seed in src/tests.c
gmaxwell Feb 21, 2019
5545e13
Merge #584: configure: Use CFLAGS_FOR_BUILD when checking native comp…
gmaxwell Feb 22, 2019
bade617
Add trivial ecmult_multi algorithm. It is selected when no scratch sp…
jonasnick Dec 20, 2018
a697d82
Add trivial ecmult_multi to the benchmark tool
jonasnick Feb 23, 2019
1419637
Merge #580: Add trivial ecmult_multi algorithm which does not require…
gmaxwell Feb 24, 2019
85d0e1b
Merge #591: Make bench_internal obey secp256k1_fe_sqrt's contract wrt…
gmaxwell Feb 24, 2019
310111e
Keep LDFLAGS if `--coverage`
DesWurstes Feb 25, 2019
dbed75d
Undefine `STATIC_PRECOMPUTATION` if using the basic config
DesWurstes Feb 25, 2019
2277af5
Fix integer overflow in ecmult_multi_var when n is large
jonasnick Oct 24, 2018
aa15154
Merge #568: Fix integer overflow in ecmult_multi_var when n is large
gmaxwell Feb 25, 2019
8348386
Add $(COMMON_LIB) to exhaustive tests to fix ARM asm build
gmaxwell Mar 9, 2019
05362ee
Merge #597: Add $(COMMON_LIB) to exhaustive tests to fix ARM asm build
gmaxwell Mar 10, 2019
d58bc93
Switch x86_64 asm to use "i" instead of "n" for immediate values.
gmaxwell Mar 10, 2019
ee99f12
Merge #599: Switch x86_64 asm to use "i" instead of "n" for immediate…
gmaxwell Mar 11, 2019
9ab96f7
Use trivial algorithm in ecmult_multi if scratch space is small
jonasnick Feb 27, 2019
248f046
Make sure we're not using an uninitialized variable in secp256k1_wnaf…
practicalswift May 6, 2018
7667532
travis: Remove unused sudo:false
Mar 30, 2019
e6d01e9
Use size_t shifts when computing a size_t
sipa Mar 30, 2019
4d01bc2
Merge #606: travis: Remove unused sudo:false
gmaxwell Mar 31, 2019
b19c000
Merge #607: Use size_t shifts when computing a size_t
gmaxwell Mar 31, 2019
d4d270a
Allow field_10x26_arm.s to compile for ARMv7 architecture
romanz Apr 21, 2019
84a8085
Merge #612: Allow field_10x26_arm.s to compile for ARMv7 architecture
gmaxwell May 9, 2019
8979ec0
Pass scalar by reference in secp256k1_wnaf_const()
real-or-random May 14, 2019
069870d
Clear a copied secret key after negation
HoOngEe May 15, 2019
16e8615
Install headers automatically
vmayoral May 15, 2019
735fbde
Merge #619: Clear a copied secret key after negation
gmaxwell May 16, 2019
975e51e
Merge #617: Pass scalar by reference in secp256k1_wnaf_const()
gmaxwell May 22, 2019
5df77a0
Merge #533: Make sure we're not using an uninitialized variable in se…
gmaxwell May 22, 2019
91fae3a
Merge #620: Install headers automatically
gmaxwell May 23, 2019
912680e
Merge #561: Respect LDFLAGS and #undef STATIC_PRECOMPUTATION if using…
gmaxwell May 23, 2019
01ee1b3
Parse DER-enconded length into a size_t instead of an int
real-or-random Nov 7, 2018
ec8f20b
Avoid out-of-bound pointers and integer overflows in size comparisons
real-or-random Nov 7, 2018
14c7dbd
Simplify control flow in DER parsing
real-or-random Nov 7, 2018
662918c
Revert "Merge #620: Install headers automatically"
doitian May 24, 2019
1a02d6c
Merge #626: Revert "Merge #620: Install headers automatically"
gmaxwell May 24, 2019
2842dc5
Make WINDOW_G configurable
real-or-random Mar 6, 2019
a61a93f
Clean up ./configure help strings
real-or-random Mar 6, 2019
36698dc
Merge #596: Make WINDOW_G configurable
gmaxwell May 25, 2019
248bffb
Guard memcmp in tests against mixed size inputs.
gmaxwell May 25, 2019
1bf7c05
Prepare for manual memory management in preallocated memory
real-or-random Oct 18, 2018
ef020de
Add size constants for preallocated memory
real-or-random Oct 22, 2018
c4fd5da
Switch to a single malloc call
real-or-random Oct 22, 2018
5feadde
Support cloning a context into preallocated memory
real-or-random Oct 25, 2018
ba12dd0
Check arguments of _preallocated functions
real-or-random Oct 25, 2018
814cc78
Add tests for contexts in preallocated memory
real-or-random Oct 25, 2018
695feb6
Export _preallocated functions
real-or-random Nov 27, 2018
238305f
Move _preallocated functions to separate header
real-or-random Nov 27, 2018
0522caa
Explain caller's obligations for preallocated memory
real-or-random Mar 29, 2019
a484e00
Merge #566: Enable context creation in preallocated memory
gmaxwell May 25, 2019
dcf3920
Fix ability to compile tests without -DVERIFY.
gmaxwell May 25, 2019
40839e2
Merge #592: Use trivial algorithm in ecmult_multi if scratch space is…
gmaxwell May 25, 2019
92a48a7
scratch space: use single allocation
apoelstra Mar 13, 2019
0be1a4a
scratch: add magic bytes to beginning of structure
apoelstra Mar 13, 2019
c2b028a
scratch space: thread `error_callback` into all scratch space functions
apoelstra Mar 13, 2019
5a4bc0b
scratch: unify allocations
apoelstra Mar 14, 2019
a7a164f
scratch: rename `max_size` to `size`, document that extra will actual…
apoelstra Mar 14, 2019
7623cf2
scratch: save a couple bytes of unnecessarily-allocated memory
apoelstra Mar 15, 2019
98836b1
scratch: replace frames with "checkpoint" system
apoelstra May 25, 2019
6c36de7
Merge #600: scratch space: use single allocation
gmaxwell May 26, 2019
cd473e0
Avoid calling secp256k1_*_is_zero when secp256k1_*_set_b32 fails.
gmaxwell May 26, 2019
6095a86
Replace CHECKs for no_precomp ctx by ARG_CHECKs without a return
real-or-random Mar 4, 2019
5db782e
Allow usage of external default callbacks
real-or-random Mar 4, 2019
908bdce
Include stdio.h and stdlib.h explicitly in secp256k1.c
real-or-random Mar 4, 2019
77defd2
Add secp256k1_ prefix to default callback functions
real-or-random Mar 9, 2019
e49f799
Add missing #(un)defines to base-config.h
real-or-random Mar 18, 2019
143dc6e
Merge #595: Allow to use external default callbacks
gmaxwell May 27, 2019
544435f
Merge #578: Avoid implementation-defined and undefined behavior when …
gmaxwell May 29, 2019
ecc94ab
Merge #627: Guard memcmp in tests against mixed size inputs.
gmaxwell May 29, 2019
1669bb2
Merge #628: Fix ability to compile tests without -DVERIFY.
gmaxwell May 29, 2019
8d1563b
Note intention of timing sidechannel freeness.
gmaxwell May 29, 2019
f34b0c3
Merge #630: Note intention of timing sidechannel freeness.
gmaxwell May 29, 2019
e541a90
Merge #629: Avoid calling _is_zero when _set_b32 fails.
gmaxwell May 29, 2019
e1fb4af
Add 64-bit integer utilities
gmaxwell Aug 5, 2015
f126331
Pedersen commitments, borromean ring signatures, and ZK range proofs.
gmaxwell Aug 5, 2015
89e7451
[RANGEPROOF BREAK] Use quadratic residue for tie break and modularity…
apoelstra Jul 4, 2016
023aa86
rangeproof: expose sidechannel message field in the signing API
apoelstra Jul 5, 2016
54fa263
Constant-time generator module
sipa Jul 6, 2016
9b00b61
Expose generator in pedersen/rangeproof API
sipa Jul 6, 2016
2bb5133
rangeproof: several API changes
apoelstra Jul 6, 2016
a66ea35
Implement ring-signature based whitelist delegation scheme
apoelstra Apr 21, 2016
94e81a2
add surjection proof module
apoelstra Jul 1, 2016
5ee6bf3
rangeproof: fix memory leak in unit tests
apoelstra Apr 22, 2017
c4097f7
surjectionproof: tests_impl.h s/assert/CHECK/g
apoelstra May 2, 2017
2cc7f1e
surjectionproof: add API unit tests
apoelstra May 2, 2017
cd4e438
surjectionproof: rename unit test functions to be more consistent wit…
apoelstra May 3, 2017
4617f04
rangeproof: add API tests
apoelstra May 3, 2017
56fca50
Fix include/secp256k1_rangeproof.h function argument documentation.
jonasnick May 8, 2017
c8f54e1
whitelist: fix serialize/parse API to take serialized length
apoelstra Jun 26, 2017
36b100c
Fix checks of whitelist serialize/parse arguments
jonasnick Jun 27, 2017
51fc58a
Add n_keys argument to whitelist_verify
jonasnick Jul 10, 2017
68be611
Fix pedersen_blind_generator_blind_sum return value documentation
jonasnick Jul 10, 2017
f1d6e4b
Fix generator makefile
instagibbs Aug 16, 2017
e93e886
generator: remove unnecessary ARG_CHECK from generate()
apoelstra Aug 30, 2017
a3ad4a8
generator: add API tests
apoelstra Aug 30, 2017
6ceccb7
add whitelist_impl.h to include for dist
instagibbs Feb 13, 2018
6872069
Add whitelisting benchmark
jonasnick Mar 16, 2018
f723bf5
Minor bugfix. Wrong length due to NUL character.
datavetaren May 16, 2018
c908c97
Reject surjection proofs with trailing garbage
real-or-random May 23, 2018
ab4fbc1
Test for rejection of trailing bytes in surjection proofs
real-or-random May 23, 2018
6f14fe4
Test for rejection of trailing bytes in range proofs
real-or-random May 24, 2018
8da4328
fix spelling in documentation
instagibbs Jun 20, 2018
b387ba0
Expose generator in shared library
FrankC01 Jul 25, 2018
cb786d6
rangeproof: add fixed vector test case
apoelstra Oct 2, 2018
65ffea4
rangeproof: check that points deserialize correctly when verifying ra…
apoelstra Oct 2, 2018
2cc4c6f
generator: verify correctness of point when parsing
apoelstra Oct 2, 2018
972d056
rangeproof: verify correctness of pedersen commitments when parsing
apoelstra Oct 2, 2018
e32924f
rangeproof: fix serialization of pedersen commintments
apoelstra Oct 8, 2018
ea62bfe
add unit test for generator and pedersen commitment roundtripping
apoelstra Oct 8, 2018
dec1b9c
Add comment to explain effect of max_n_iterations in surjectionproof_…
jonasnick Apr 17, 2018
e9fea74
Add explanation about how BIP32 unhardened derivation can be used to …
jonasnick Nov 19, 2018
0593861
Enable more builds with rest of experimental flags
instagibbs Jan 3, 2019
14769b9
rangeproof: reduce iteration count in unit tests
apoelstra Jan 3, 2019
9a8a71e
use proper types for rangeproof min/max
instagibbs Jan 3, 2019
a8ae6ba
add chacha20 function
apoelstra Apr 3, 2018
5d5374f
Add schnorrsig module which implements BIP-schnorr [0] compatible sig…
apoelstra May 9, 2018
b61a1a9
Add MuSig module which allows creating n-of-n multisignatures and ada…
jonasnick Dec 22, 2018
0ad6b60
Add 3-of-3 MuSig example
jonasnick Dec 22, 2018
ff16651
musig: add user documentation
apoelstra Feb 8, 2019
cd5ba5c
generator: remove `CHECK` abort calls exposed by public API
apoelstra Mar 27, 2019
865b761
Fix a small typo in the generator parameter name
romanz Apr 11, 2019
86240b2
Clean up ./configure help strings (zkp extensions)
real-or-random Apr 5, 2019
15d9278
Add bench_generator and bench_rangeproof to .gitignore
romanz May 14, 2019
898c9f0
Clarify how to derive alternative generator H
jonasnick May 12, 2019
4a77633
Improve explanation of key cancellation attack in whitelist.md
jonasnick Mar 28, 2019
250ebb3
work in progress: add _allocate_initialized/destroy funcs
dgpv Apr 21, 2019
6f3b0c0
Improve comments for surctionproof init+alloc/destroy funcs
dgpv May 26, 2019
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
bench_inv
bench_ecdh
bench_ecmult
bench_generator
bench_rangeproof
bench_schnorrsig
bench_sign
bench_verify
bench_schnorr_verify
bench_recover
bench_internal
tests
Expand Down
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: c
sudo: false
os: linux
addons:
apt:
packages: libgmp-dev
Expand All @@ -11,9 +11,11 @@ cache:
- src/java/guava/
env:
global:
- FIELD=auto BIGNUM=auto SCALAR=auto ENDOMORPHISM=no STATICPRECOMPUTATION=yes ASM=no BUILD=check EXTRAFLAGS= HOST= ECDH=no RECOVERY=no EXPERIMENTAL=no JNI=no
- FIELD=auto BIGNUM=auto SCALAR=auto ENDOMORPHISM=no STATICPRECOMPUTATION=yes ASM=no BUILD=check EXTRAFLAGS= HOST= ECDH=no RECOVERY=no EXPERIMENTAL=no JNI=no GENERATOR=no RANGEPROOF=no WHITELIST=no
- GUAVA_URL=https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar GUAVA_JAR=src/java/guava/guava-18.0.jar
matrix:
- SCALAR=32bit FIELD=32bit EXPERIMENTAL=yes RANGEPROOF=yes WHITELIST=yes GENERATOR=yes
- FIELD=64bit EXPERIMENTAL=yes RANGEPROOF=yes WHITELIST=yes GENERATOR=yes
- SCALAR=32bit RECOVERY=yes
- SCALAR=32bit FIELD=32bit ECDH=yes EXPERIMENTAL=yes
- SCALAR=64bit
Expand Down Expand Up @@ -65,5 +67,4 @@ before_script: ./autogen.sh
script:
- if [ -n "$HOST" ]; then export USE_HOST="--host=$HOST"; fi
- if [ "x$HOST" = "xi686-linux-gnu" ]; then export CC="$CC -m32"; fi
- ./configure --enable-experimental=$EXPERIMENTAL --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-scalar=$SCALAR --enable-ecmult-static-precomputation=$STATICPRECOMPUTATION --enable-module-ecdh=$ECDH --enable-module-recovery=$RECOVERY --enable-jni=$JNI $EXTRAFLAGS $USE_HOST && make -j2 $BUILD
os: linux
- ./configure --enable-experimental=$EXPERIMENTAL --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-scalar=$SCALAR --enable-ecmult-static-precomputation=$STATICPRECOMPUTATION --enable-module-ecdh=$ECDH --enable-module-recovery=$RECOVERY --enable-module-rangeproof=$RANGEPROOF --enable-module-whitelist=$WHITELIST --enable-module-generator=$GENERATOR --enable-jni=$JNI $EXTRAFLAGS $USE_HOST && make -j2 $BUILD
30 changes: 27 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ else
JNI_LIB =
endif
include_HEADERS = include/secp256k1.h
include_HEADERS += include/secp256k1_preallocated.h
noinst_HEADERS =
noinst_HEADERS += src/scalar.h
noinst_HEADERS += src/scalar_4x64.h
Expand Down Expand Up @@ -114,7 +115,7 @@ exhaustive_tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src $(SECP_INCLUDE
if !ENABLE_COVERAGE
exhaustive_tests_CPPFLAGS += -DVERIFY
endif
exhaustive_tests_LDADD = $(SECP_LIBS)
exhaustive_tests_LDADD = $(SECP_LIBS) $(COMMON_LIB)
exhaustive_tests_LDFLAGS = -static
TESTS += exhaustive_tests
endif
Expand Down Expand Up @@ -151,15 +152,14 @@ endif

if USE_ECMULT_STATIC_PRECOMPUTATION
CPPFLAGS_FOR_BUILD +=-I$(top_srcdir)
CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function

gen_context_OBJECTS = gen_context.o
gen_context_BIN = gen_context$(BUILD_EXEEXT)
gen_%.o: src/gen_%.c
$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@

$(gen_context_BIN): $(gen_context_OBJECTS)
$(CC_FOR_BUILD) $^ -o $@
$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $^ -o $@

$(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h
$(tests_OBJECTS): src/ecmult_static_context.h
Expand All @@ -178,6 +178,30 @@ if ENABLE_MODULE_ECDH
include src/modules/ecdh/Makefile.am.include
endif

if ENABLE_MODULE_SCHNORRSIG
include src/modules/schnorrsig/Makefile.am.include
endif

if ENABLE_MODULE_MUSIG
include src/modules/musig/Makefile.am.include
endif

if ENABLE_MODULE_RECOVERY
include src/modules/recovery/Makefile.am.include
endif

if ENABLE_MODULE_GENERATOR
include src/modules/generator/Makefile.am.include
endif

if ENABLE_MODULE_RANGEPROOF
include src/modules/rangeproof/Makefile.am.include
endif

if ENABLE_MODULE_WHITELIST
include src/modules/whitelist/Makefile.am.include
endif

if ENABLE_MODULE_SURJECTIONPROOF
include src/modules/surjection/Makefile.am.include
endif
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ Implementation details
* Optionally (off by default) use secp256k1's efficiently-computable endomorphism to split the P multiplicand into 2 half-sized ones.
* Point multiplication for signing
* Use a precomputed table of multiples of powers of 16 multiplied with the generator, so general multiplication becomes a series of additions.
* Access the table with branch-free conditional moves so memory access is uniform.
* No data-dependent branches
* Intended to be completely free of timing sidechannels for secret-key operations (on reasonable hardware/toolchains)
* Access the table with branch-free conditional moves so memory access is uniform.
* No data-dependent branches
* Optional runtime blinding which attempts to frustrate differential power analysis.
* The precomputed tables add and eventually subtract points for which no known scalar (private key) is known, preventing even an attacker with control over the private key used to control the data internally.

Build steps
Expand Down
Loading