Skip to content

Commit 3a1fd2d

Browse files
committed
Merge #549: Bump secp256k1-sys version to 0.7.0
3fa2436 Bump secp256k1-sys version to 0.7.0 (Tobin C. Harding) Pull request description: We are ready to release a new minor version of `secp256k1-sys`, in order to do so we must make change the symbol names to reflect the new version as well as the usual changelog and version bump. In preparation for releasing `secp256k1-sys` v0.7.0 do: - Rename symbols to from `0_6_1` -> `0_7_0`, done mechanically (search and replace) - Add changes log notes - Bump `secp256k1-sys` crate version 0.6.1 -> 0.7.0, justified because we have added new public methods to various types (e.g., `PublicKey::cmp_fast_unstable`) ### Notes I based this PR on: - https://github.com/rust-bitcoin/rust-secp256k1/pull/490/files - https://github.com/rust-bitcoin/rust-secp256k1/pull/457/files ACKs for top commit: apoelstra: ACK 3fa2436 Tree-SHA512: cb16de633865f26613aa29479ac6a6299b1790a00372cca61173f09a753179fa1d619b91ca25ba5872f571d3d9372b46731f9d4b3e8050077ec3c73d583f54ce
2 parents ff4be18 + 3fa2436 commit 3a1fd2d

File tree

99 files changed

+5693
-5689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+5693
-5689
lines changed

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ global-context = ["std"]
3737
global-context-less-secure = ["global-context"]
3838

3939
[dependencies]
40-
secp256k1-sys = { version = "0.6.0", default-features = false, path = "./secp256k1-sys" }
40+
secp256k1-sys = { version = "0.7.0", default-features = false, path = "./secp256k1-sys" }
4141
serde = { version = "1.0", default-features = false, optional = true }
4242

4343
# You likely only want to enable these if you explicitly do not want to use "std", otherwise enable

Diff for: secp256k1-sys/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.7.0 - 2022-12-01
2+
3+
* [Make comparison functions stable across library versions](https://github.com/rust-bitcoin/rust-secp256k1/pull/518)
4+
* Add public methods `cmp_fast_unstable` and `eq_fast_unstable` for types that contain an inner array (see PR linked above).
15

26
# 0.6.0 - 2022-06-21
37

Diff for: secp256k1-sys/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1-sys"
3-
version = "0.6.1"
3+
version = "0.7.0"
44
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
55
"Andrew Poelstra <[email protected]>",
66
"Steven Roose <[email protected]>" ]
@@ -12,7 +12,7 @@ description = "FFI for Pieter Wuille's `libsecp256k1` library."
1212
keywords = [ "secp256k1", "libsecp256k1", "ffi" ]
1313
readme = "README.md"
1414
build = "build.rs"
15-
links = "rustsecp256k1_v0_6_1"
15+
links = "rustsecp256k1_v0_7_0"
1616
edition = "2018"
1717

1818
# Should make docs.rs show all functions, even those behind non-default features

Diff for: secp256k1-sys/depend/secp256k1/Makefile.am

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AM_CFLAGS = $(SECP_CFLAGS)
88

99
lib_LTLIBRARIES = libsecp256k1.la
1010
include_HEADERS = include/secp256k1.h
11-
include_HEADERS += include/rustsecp256k1_v0_6_1_preallocated.h
11+
include_HEADERS += include/rustsecp256k1_v0_7_0_preallocated.h
1212
noinst_HEADERS =
1313
noinst_HEADERS += src/scalar.h
1414
noinst_HEADERS += src/scalar_4x64.h
@@ -64,13 +64,13 @@ noinst_HEADERS += contrib/lax_der_parsing.c
6464
noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
6565
noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
6666

67-
PRECOMPUTED_LIB = librustsecp256k1_v0_6_1_precomputed.la
67+
PRECOMPUTED_LIB = librustsecp256k1_v0_7_0_precomputed.la
6868
noinst_LTLIBRARIES = $(PRECOMPUTED_LIB)
69-
librustsecp256k1_v0_6_1_precomputed_la_SOURCES = src/precomputed_ecmult.c src/precomputed_ecmult_gen.c
70-
librustsecp256k1_v0_6_1_precomputed_la_CPPFLAGS = $(SECP_INCLUDES)
69+
librustsecp256k1_v0_7_0_precomputed_la_SOURCES = src/precomputed_ecmult.c src/precomputed_ecmult_gen.c
70+
librustsecp256k1_v0_7_0_precomputed_la_CPPFLAGS = $(SECP_INCLUDES)
7171

7272
if USE_EXTERNAL_ASM
73-
COMMON_LIB = librustsecp256k1_v0_6_1_common.la
73+
COMMON_LIB = librustsecp256k1_v0_7_0_common.la
7474
else
7575
COMMON_LIB =
7676
endif
@@ -81,17 +81,17 @@ pkgconfig_DATA = libsecp256k1.pc
8181

8282
if USE_EXTERNAL_ASM
8383
if USE_ASM_ARM
84-
librustsecp256k1_v0_6_1_common_la_SOURCES = src/asm/field_10x26_arm.s
84+
librustsecp256k1_v0_7_0_common_la_SOURCES = src/asm/field_10x26_arm.s
8585
endif
8686
endif
8787

88-
librustsecp256k1_v0_6_1_la_SOURCES = src/secp256k1.c
89-
librustsecp256k1_v0_6_1_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
90-
librustsecp256k1_v0_6_1_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
91-
librustsecp256k1_v0_6_1_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_CURRENT):$(LIB_VERSION_REVISION):$(LIB_VERSION_AGE)
88+
librustsecp256k1_v0_7_0_la_SOURCES = src/secp256k1.c
89+
librustsecp256k1_v0_7_0_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
90+
librustsecp256k1_v0_7_0_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
91+
librustsecp256k1_v0_7_0_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_CURRENT):$(LIB_VERSION_REVISION):$(LIB_VERSION_AGE)
9292

9393
if VALGRIND_ENABLED
94-
librustsecp256k1_v0_6_1_la_CPPFLAGS += -DVALGRIND
94+
librustsecp256k1_v0_7_0_la_CPPFLAGS += -DVALGRIND
9595
endif
9696

9797
noinst_PROGRAMS =

Diff for: secp256k1-sys/depend/secp256k1/contrib/lax_der_parsing.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
#include "lax_der_parsing.h"
1010

11-
int rustsecp256k1_v0_6_1_ecdsa_signature_parse_der_lax(const rustsecp256k1_v0_6_1_context* ctx, rustsecp256k1_v0_6_1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
11+
int rustsecp256k1_v0_7_0_ecdsa_signature_parse_der_lax(const rustsecp256k1_v0_7_0_context* ctx, rustsecp256k1_v0_7_0_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
1212
size_t rpos, rlen, spos, slen;
1313
size_t pos = 0;
1414
size_t lenbyte;
1515
unsigned char tmpsig[64] = {0};
1616
int overflow = 0;
1717

1818
/* Hack to initialize sig with a correctly-parsed but invalid signature. */
19-
rustsecp256k1_v0_6_1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
19+
rustsecp256k1_v0_7_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
2020

2121
/* Sequence tag byte */
2222
if (pos == inputlen || input[pos] != 0x30) {
@@ -137,11 +137,11 @@ int rustsecp256k1_v0_6_1_ecdsa_signature_parse_der_lax(const rustsecp256k1_v0_6_
137137
}
138138

139139
if (!overflow) {
140-
overflow = !rustsecp256k1_v0_6_1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
140+
overflow = !rustsecp256k1_v0_7_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
141141
}
142142
if (overflow) {
143143
memset(tmpsig, 0, 64);
144-
rustsecp256k1_v0_6_1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
144+
rustsecp256k1_v0_7_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
145145
}
146146
return 1;
147147
}

Diff for: secp256k1-sys/depend/secp256k1/contrib/lax_der_parsing.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
* certain violations are easily supported. You may need to adapt it.
2727
*
2828
* Do not use this for new systems. Use well-defined DER or compact signatures
29-
* instead if you have the choice (see rustsecp256k1_v0_6_1_ecdsa_signature_parse_der and
30-
* rustsecp256k1_v0_6_1_ecdsa_signature_parse_compact).
29+
* instead if you have the choice (see rustsecp256k1_v0_7_0_ecdsa_signature_parse_der and
30+
* rustsecp256k1_v0_7_0_ecdsa_signature_parse_compact).
3131
*
3232
* The supported violations are:
3333
* - All numbers are parsed as nonnegative integers, even though X.609-0207
@@ -83,9 +83,9 @@ extern "C" {
8383
* encoded numbers are out of range, signature validation with it is
8484
* guaranteed to fail for every message and public key.
8585
*/
86-
int rustsecp256k1_v0_6_1_ecdsa_signature_parse_der_lax(
87-
const rustsecp256k1_v0_6_1_context* ctx,
88-
rustsecp256k1_v0_6_1_ecdsa_signature* sig,
86+
int rustsecp256k1_v0_7_0_ecdsa_signature_parse_der_lax(
87+
const rustsecp256k1_v0_7_0_context* ctx,
88+
rustsecp256k1_v0_7_0_ecdsa_signature* sig,
8989
const unsigned char *input,
9090
size_t inputlen
9191
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);

Diff for: secp256k1-sys/depend/secp256k1/contrib/lax_der_privatekey_parsing.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "lax_der_privatekey_parsing.h"
1010

11-
int ec_privkey_import_der(const rustsecp256k1_v0_6_1_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
11+
int ec_privkey_import_der(const rustsecp256k1_v0_7_0_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
1212
const unsigned char *end = privkey + privkeylen;
1313
int lenb = 0;
1414
int len = 0;
@@ -45,17 +45,17 @@ int ec_privkey_import_der(const rustsecp256k1_v0_6_1_context* ctx, unsigned char
4545
return 0;
4646
}
4747
if (privkey[1]) memcpy(out32 + 32 - privkey[1], privkey + 2, privkey[1]);
48-
if (!rustsecp256k1_v0_6_1_ec_seckey_verify(ctx, out32)) {
48+
if (!rustsecp256k1_v0_7_0_ec_seckey_verify(ctx, out32)) {
4949
memset(out32, 0, 32);
5050
return 0;
5151
}
5252
return 1;
5353
}
5454

55-
int ec_privkey_export_der(const rustsecp256k1_v0_6_1_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
56-
rustsecp256k1_v0_6_1_pubkey pubkey;
55+
int ec_privkey_export_der(const rustsecp256k1_v0_7_0_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
56+
rustsecp256k1_v0_7_0_pubkey pubkey;
5757
size_t pubkeylen = 0;
58-
if (!rustsecp256k1_v0_6_1_ec_pubkey_create(ctx, &pubkey, key32)) {
58+
if (!rustsecp256k1_v0_7_0_ec_pubkey_create(ctx, &pubkey, key32)) {
5959
*privkeylen = 0;
6060
return 0;
6161
}
@@ -79,7 +79,7 @@ int ec_privkey_export_der(const rustsecp256k1_v0_6_1_context *ctx, unsigned char
7979
memcpy(ptr, key32, 32); ptr += 32;
8080
memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
8181
pubkeylen = 33;
82-
rustsecp256k1_v0_6_1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
82+
rustsecp256k1_v0_7_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
8383
ptr += pubkeylen;
8484
*privkeylen = ptr - privkey;
8585
} else {
@@ -104,7 +104,7 @@ int ec_privkey_export_der(const rustsecp256k1_v0_6_1_context *ctx, unsigned char
104104
memcpy(ptr, key32, 32); ptr += 32;
105105
memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
106106
pubkeylen = 65;
107-
rustsecp256k1_v0_6_1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
107+
rustsecp256k1_v0_7_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
108108
ptr += pubkeylen;
109109
*privkeylen = ptr - privkey;
110110
}

Diff for: secp256k1-sys/depend/secp256k1/contrib/lax_der_privatekey_parsing.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ extern "C" {
5858
* simple 32-byte private keys are sufficient.
5959
*
6060
* Note that this function does not guarantee correct DER output. It is
61-
* guaranteed to be parsable by rustsecp256k1_v0_6_1_ec_privkey_import_der
61+
* guaranteed to be parsable by rustsecp256k1_v0_7_0_ec_privkey_import_der
6262
*/
6363
SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
64-
const rustsecp256k1_v0_6_1_context* ctx,
64+
const rustsecp256k1_v0_7_0_context* ctx,
6565
unsigned char *privkey,
6666
size_t *privkeylen,
6767
const unsigned char *seckey,
@@ -83,7 +83,7 @@ SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
8383
* key.
8484
*/
8585
SECP256K1_WARN_UNUSED_RESULT int ec_privkey_import_der(
86-
const rustsecp256k1_v0_6_1_context* ctx,
86+
const rustsecp256k1_v0_7_0_context* ctx,
8787
unsigned char *seckey,
8888
const unsigned char *privkey,
8989
size_t privkeylen

0 commit comments

Comments
 (0)