Skip to content

Commit

Permalink
Merge #653: Update vendored lib secp256k1 to v0.4.0
Browse files Browse the repository at this point in the history
80b2a8d Update vendored libsecp to v0.4.0 (Davidson Souza)
d2285c9 ci: Remove MIPS* from CI (Davidson Souza)
0d58f50 ci: generalize grp in "illegal callback" test (Andrew Poelstra)
acf9ac1 delete `test_manual_create_destroy` test (Andrew Poelstra)
04ce508 lib: fix bad unit test (Andrew Poelstra)
e4cca90 gitignore: remove things that shouldn't be there (Andrew Poelstra)

Pull request description:

  Replaces  #645 and #652. Precedes #627.

  I'm basically using #652 but resolving the linking problems,

  My local CI is erring on windows cross-test, but I can compile without issue with `cargo build --target x86_64-pc-windows-gnu`. Some MIPS jobs failed before even installing cross, I think those aren't really related to this PR. Any ideas on what can be happening?

ACKs for top commit:
  apoelstra:
    ACK 80b2a8d

Tree-SHA512: 62c2e04348110e3995111fa666f10dcc403b963770d047361f9209cf45b45db8744a7eb6d9ee3278d18007412dab5131ac3e1dd3e3d704963c6a6f232d57199a
  • Loading branch information
apoelstra committed Sep 30, 2023
2 parents 302ff20 + 80b2a8d commit da4f67b
Show file tree
Hide file tree
Showing 159 changed files with 21,825 additions and 8,073 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ jobs:
- arm-unknown-linux-gnueabi
- arm-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
- mips-unknown-linux-gnu
- mips64-unknown-linux-gnuabi64
- mips64el-unknown-linux-gnuabi64
- mipsel-unknown-linux-gnu
- powerpc-unknown-linux-gnu
# - powerpc64-unknown-linux-gnu # not supported by cross
- powerpc64le-unknown-linux-gnu
Expand Down
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
target/
Cargo.lock

#IntelliJ project files
.idea
*.iml

CMakeLists.txt
cmake-build-debug
2 changes: 1 addition & 1 deletion Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ dependencies = [

[[package]]
name = "secp256k1-sys"
version = "0.8.1"
version = "0.9.0"
dependencies = [
"cc",
"libc",
Expand Down
2 changes: 1 addition & 1 deletion Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ dependencies = [

[[package]]
name = "secp256k1-sys"
version = "0.8.1"
version = "0.9.0"
dependencies = [
"cc",
"libc",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ global-context = ["std"]
global-context-less-secure = ["global-context"]

[dependencies]
secp256k1-sys = { version = "0.8.1", default-features = false, path = "./secp256k1-sys" }
secp256k1-sys = { version = "0.9.0", default-features = false, path = "./secp256k1-sys" }
serde = { version = "1.0.103", default-features = false, optional = true }

# You likely only want to enable these if you explicitly do not want to use "std", otherwise enable
Expand Down
2 changes: 1 addition & 1 deletion contrib/_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
# Test if panic in C code aborts the process (either with a real panic or with SIGILL)
cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 \
| tee /dev/stderr \
| grep "SIGILL\\|\[libsecp256k1] illegal argument. !rustsecp256k1_v0_._._fe_is_zero(&ge->x)"
| grep "SIGILL\\|\[libsecp256k1] illegal argument. "

# Make all cargo invocations verbose
export CARGO_TERM_VERBOSE=true
Expand Down
4 changes: 2 additions & 2 deletions secp256k1-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "secp256k1-sys"
version = "0.8.1"
version = "0.9.0"
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
"Andrew Poelstra <[email protected]>",
"Steven Roose <[email protected]>" ]
Expand All @@ -12,7 +12,7 @@ description = "FFI for Pieter Wuille's `libsecp256k1` library."
keywords = [ "secp256k1", "libsecp256k1", "ffi" ]
readme = "README.md"
build = "build.rs"
links = "rustsecp256k1_v0_8_1"
links = "rustsecp256k1_v0_9_0"
edition = "2018"

[package.metadata.docs.rs]
Expand Down
6 changes: 6 additions & 0 deletions secp256k1-sys/depend/lax_der_parsing.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
10c10,12
<
---
> extern int secp256k1_ecdsa_signature_parse_compact(
> const secp256k1_context *ctx,
> secp256k1_ecdsa_signature *sig, const unsigned char *input64);
2 changes: 1 addition & 1 deletion secp256k1-sys/depend/secp256k1-HEAD-revision.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file was automatically created by vendor-libsecp.sh
21ffe4b22a9683cf24ae0763359e401d1284cc7a
199d27cea32203b224b208627533c2e813cd3b21
21 changes: 14 additions & 7 deletions secp256k1-sys/depend/secp256k1.c.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
139,149d138
140,150d139
< secp256k1_context* secp256k1_context_create(unsigned int flags) {
< size_t const prealloc_size = secp256k1_context_preallocated_size(flags);
< secp256k1_context* ctx = (secp256k1_context*)checked_malloc(&default_error_callback, prealloc_size);
Expand All @@ -10,27 +10,34 @@
< return ctx;
< }
<
164,174d152
162,174d150
< secp256k1_context* secp256k1_context_clone(const secp256k1_context* ctx) {
< secp256k1_context* ret;
< size_t prealloc_size;
<
< VERIFY_CHECK(ctx != NULL);
< ARG_CHECK(secp256k1_context_is_proper(ctx));
<
< prealloc_size = secp256k1_context_preallocated_clone_size(ctx);
< ret = (secp256k1_context*)checked_malloc(&ctx->error_callback, prealloc_size);
< ret = secp256k1_context_preallocated_clone(ctx, ret);
< return ret;
< }
<
183,189d160
186,197d161
< void secp256k1_context_destroy(secp256k1_context* ctx) {
< if (ctx != NULL) {
< secp256k1_context_preallocated_destroy(ctx);
< free(ctx);
< ARG_CHECK_VOID(ctx == NULL || secp256k1_context_is_proper(ctx));
<
< /* Defined as noop */
< if (ctx == NULL) {
< return;
< }
<
< secp256k1_context_preallocated_destroy(ctx);
< free(ctx);
< }
<
206,215d176
220,229d183
< }
<
< secp256k1_scratch_space* secp256k1_scratch_space_create(const secp256k1_context* ctx, size_t max_size) {
Expand Down
40 changes: 27 additions & 13 deletions secp256k1-sys/depend/secp256k1.h.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
226,228d225
< SECP256K1_API secp256k1_context* secp256k1_context_create(
236d235
< SECP256K1_API const secp256k1_context *secp256k1_context_static;
239,240d237
< SECP256K1_API const secp256k1_context *secp256k1_context_no_precomp
< SECP256K1_DEPRECATED("Use secp256k1_context_static instead");
286,289d282
< SECP256K1_API secp256k1_context *secp256k1_context_create(
< unsigned int flags
< ) SECP256K1_WARN_UNUSED_RESULT;
231,233d227
< SECP256K1_API secp256k1_context* secp256k1_context_clone(
< const secp256k1_context* ctx
<
302,305d294
< SECP256K1_API secp256k1_context *secp256k1_context_clone(
< const secp256k1_context *ctx
< ) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT;
248,250d241
<
320,323d308
< SECP256K1_API void secp256k1_context_destroy(
< secp256k1_context* ctx
< secp256k1_context *ctx
< ) SECP256K1_ARG_NONNULL(1);
327,330d317
< SECP256K1_API SECP256K1_WARN_UNUSED_RESULT secp256k1_scratch_space* secp256k1_scratch_space_create(
< const secp256k1_context* ctx,
<
402,406d386
< SECP256K1_API SECP256K1_WARN_UNUSED_RESULT secp256k1_scratch_space *secp256k1_scratch_space_create(
< const secp256k1_context *ctx,
< size_t size
< ) SECP256K1_ARG_NONNULL(1);
338,341d324
<
413,417d392
< SECP256K1_API void secp256k1_scratch_space_destroy(
< const secp256k1_context* ctx,
< secp256k1_scratch_space* scratch
< const secp256k1_context *ctx,
< secp256k1_scratch_space *scratch
< ) SECP256K1_ARG_NONNULL(1);
<
636d610
< SECP256K1_API const secp256k1_nonce_function secp256k1_nonce_function_rfc6979;
639d612
< SECP256K1_API const secp256k1_nonce_function secp256k1_nonce_function_default;
Loading

0 comments on commit da4f67b

Please sign in to comment.