This repository was archived by the owner on Feb 26, 2020. It is now read-only.
forked from arkpar/rust-secp256k1
-
Notifications
You must be signed in to change notification settings - Fork 37
update c-lib to upstream #19
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
14d5948
update c-lib to f5c8a005f9d8948a16a0cb1c30c991df3e1f4a29
ordian 1e36141
disable USE_EXTERNAL_DEFAULT_CALLBACKS
ordian ca76e06
tabify
ordian 7c90589
[build.rs] document magic constants
ordian 0b62c27
tabify
ordian 81b1a4e
[build.rs] add a comment about SCHNORR support
ordian 8172b3e
argh
ordian 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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #include <stdint.h> | ||
|
|
||
| int main(void) { | ||
| __uint128_t var_128; | ||
| uint64_t var_64; | ||
|
|
||
| /* Try to shut up "unused variable" warnings */ | ||
| var_64 = 100; | ||
| var_128 = 100; | ||
| if (var_64 == var_128) { | ||
| var_64 = 20; | ||
| } | ||
| return 0; | ||
| } |
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 |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -42,6 +43,8 @@ noinst_HEADERS += src/field_5x52_asm_impl.h | |
| noinst_HEADERS += src/java/org_bitcoin_NativeSecp256k1.h | ||
| noinst_HEADERS += src/java/org_bitcoin_Secp256k1Context.h | ||
| noinst_HEADERS += src/util.h | ||
| noinst_HEADERS += src/scratch.h | ||
| noinst_HEADERS += src/scratch_impl.h | ||
| noinst_HEADERS += src/testrand.h | ||
| noinst_HEADERS += src/testrand_impl.h | ||
| noinst_HEADERS += src/hash.h | ||
|
|
@@ -79,14 +82,17 @@ libsecp256k1_jni_la_CPPFLAGS = -DSECP256K1_BUILD $(JNI_INCLUDES) | |
|
|
||
| noinst_PROGRAMS = | ||
| if USE_BENCHMARK | ||
| noinst_PROGRAMS += bench_verify bench_sign bench_internal | ||
| noinst_PROGRAMS += bench_verify bench_sign bench_internal bench_ecmult | ||
| bench_verify_SOURCES = src/bench_verify.c | ||
| bench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB) | ||
| bench_sign_SOURCES = src/bench_sign.c | ||
| bench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB) | ||
| bench_internal_SOURCES = src/bench_internal.c | ||
| bench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB) | ||
| bench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES) | ||
| bench_ecmult_SOURCES = src/bench_ecmult.c | ||
| bench_ecmult_LDADD = $(SECP_LIBS) $(COMMON_LIB) | ||
| bench_ecmult_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES) | ||
| endif | ||
|
|
||
| TESTS = | ||
|
|
@@ -109,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 | ||
|
|
@@ -145,20 +151,20 @@ endif | |
| endif | ||
|
|
||
| if USE_ECMULT_STATIC_PRECOMPUTATION | ||
| CPPFLAGS_FOR_BUILD +=-I$(top_srcdir) | ||
| CFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function | ||
| CPPFLAGS_FOR_BUILD +=-I$(top_srcdir) -I$(builddir)/src | ||
|
|
||
| gen_context_OBJECTS = gen_context.o | ||
| gen_context_BIN = gen_context$(BUILD_EXEEXT) | ||
| gen_%.o: src/gen_%.c | ||
| gen_%.o: src/gen_%.c src/libsecp256k1-config.h | ||
| $(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 | ||
| $(bench_internal_OBJECTS): src/ecmult_static_context.h | ||
| $(bench_ecmult_OBJECTS): src/ecmult_static_context.h | ||
|
|
||
| src/ecmult_static_context.h: $(gen_context_BIN) | ||
| ./$(gen_context_BIN) | ||
|
|
@@ -172,10 +178,6 @@ if ENABLE_MODULE_ECDH | |
| include src/modules/ecdh/Makefile.am.include | ||
| endif | ||
|
|
||
| if ENABLE_MODULE_SCHNORR | ||
|
Author
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. seems like schnorr support was removed, do we use it though? 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. afaik we do not, but maybe @svyatonik can help with that too? 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. Ehhh...The only thing I can guarantee is that we don't use it in blockchain clients - parity-ethereum (and specifically in SecretStore), parity-bitcoin, parity-zcash (and obviously in substrate). Can't tell about the the rest... |
||
| include src/modules/schnorr/Makefile.am.include | ||
| endif | ||
|
|
||
| if ENABLE_MODULE_RECOVERY | ||
| include src/modules/recovery/Makefile.am.include | ||
| endif | ||
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
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.
This doesn't mean the same thing as in Rust I take it? But what does it mean? Includes symbols?
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.
we used "-g" flag previously, I guess this should mean the same
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.
Hmm, so what does
-gmean?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.
That's the same as
debug = truein rust, adds debug symbols to the build (doesn't downgrade the perf much)