Skip to content

Commit

Permalink
Bump secp256k1-sys version to 0.7.0
Browse files Browse the repository at this point in the history
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`)
  • Loading branch information
tcharding committed Dec 11, 2022
1 parent ff4be18 commit 3fa2436
Show file tree
Hide file tree
Showing 99 changed files with 5,693 additions and 5,689 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -37,7 +37,7 @@ global-context = ["std"]
global-context-less-secure = ["global-context"]

[dependencies]
secp256k1-sys = { version = "0.6.0", default-features = false, path = "./secp256k1-sys" }
secp256k1-sys = { version = "0.7.0", default-features = false, path = "./secp256k1-sys" }
serde = { version = "1.0", 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
4 changes: 4 additions & 0 deletions secp256k1-sys/CHANGELOG.md
@@ -1,3 +1,7 @@
# 0.7.0 - 2022-12-01

* [Make comparison functions stable across library versions](https://github.com/rust-bitcoin/rust-secp256k1/pull/518)
* Add public methods `cmp_fast_unstable` and `eq_fast_unstable` for types that contain an inner array (see PR linked above).

# 0.6.0 - 2022-06-21

Expand Down
4 changes: 2 additions & 2 deletions secp256k1-sys/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "secp256k1-sys"
version = "0.6.1"
version = "0.7.0"
authors = [ "Dawid Ciężarkiewicz <dpc@ucore.info>",
"Andrew Poelstra <apoelstra@wpsoftware.net>",
"Steven Roose <steven@stevenroose.org>" ]
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_6_1"
links = "rustsecp256k1_v0_7_0"
edition = "2018"

# Should make docs.rs show all functions, even those behind non-default features
Expand Down
22 changes: 11 additions & 11 deletions secp256k1-sys/depend/secp256k1/Makefile.am
Expand Up @@ -8,7 +8,7 @@ AM_CFLAGS = $(SECP_CFLAGS)

lib_LTLIBRARIES = libsecp256k1.la
include_HEADERS = include/secp256k1.h
include_HEADERS += include/rustsecp256k1_v0_6_1_preallocated.h
include_HEADERS += include/rustsecp256k1_v0_7_0_preallocated.h
noinst_HEADERS =
noinst_HEADERS += src/scalar.h
noinst_HEADERS += src/scalar_4x64.h
Expand Down Expand Up @@ -64,13 +64,13 @@ noinst_HEADERS += contrib/lax_der_parsing.c
noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
noinst_HEADERS += contrib/lax_der_privatekey_parsing.c

PRECOMPUTED_LIB = librustsecp256k1_v0_6_1_precomputed.la
PRECOMPUTED_LIB = librustsecp256k1_v0_7_0_precomputed.la
noinst_LTLIBRARIES = $(PRECOMPUTED_LIB)
librustsecp256k1_v0_6_1_precomputed_la_SOURCES = src/precomputed_ecmult.c src/precomputed_ecmult_gen.c
librustsecp256k1_v0_6_1_precomputed_la_CPPFLAGS = $(SECP_INCLUDES)
librustsecp256k1_v0_7_0_precomputed_la_SOURCES = src/precomputed_ecmult.c src/precomputed_ecmult_gen.c
librustsecp256k1_v0_7_0_precomputed_la_CPPFLAGS = $(SECP_INCLUDES)

if USE_EXTERNAL_ASM
COMMON_LIB = librustsecp256k1_v0_6_1_common.la
COMMON_LIB = librustsecp256k1_v0_7_0_common.la
else
COMMON_LIB =
endif
Expand All @@ -81,17 +81,17 @@ pkgconfig_DATA = libsecp256k1.pc

if USE_EXTERNAL_ASM
if USE_ASM_ARM
librustsecp256k1_v0_6_1_common_la_SOURCES = src/asm/field_10x26_arm.s
librustsecp256k1_v0_7_0_common_la_SOURCES = src/asm/field_10x26_arm.s
endif
endif

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

if VALGRIND_ENABLED
librustsecp256k1_v0_6_1_la_CPPFLAGS += -DVALGRIND
librustsecp256k1_v0_7_0_la_CPPFLAGS += -DVALGRIND
endif

noinst_PROGRAMS =
Expand Down
8 changes: 4 additions & 4 deletions secp256k1-sys/depend/secp256k1/contrib/lax_der_parsing.c
Expand Up @@ -8,15 +8,15 @@

#include "lax_der_parsing.h"

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) {
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) {
size_t rpos, rlen, spos, slen;
size_t pos = 0;
size_t lenbyte;
unsigned char tmpsig[64] = {0};
int overflow = 0;

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

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

if (!overflow) {
overflow = !rustsecp256k1_v0_6_1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
overflow = !rustsecp256k1_v0_7_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
}
if (overflow) {
memset(tmpsig, 0, 64);
rustsecp256k1_v0_6_1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
rustsecp256k1_v0_7_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
}
return 1;
}
Expand Down
10 changes: 5 additions & 5 deletions secp256k1-sys/depend/secp256k1/contrib/lax_der_parsing.h
Expand Up @@ -26,8 +26,8 @@
* certain violations are easily supported. You may need to adapt it.
*
* Do not use this for new systems. Use well-defined DER or compact signatures
* instead if you have the choice (see rustsecp256k1_v0_6_1_ecdsa_signature_parse_der and
* rustsecp256k1_v0_6_1_ecdsa_signature_parse_compact).
* instead if you have the choice (see rustsecp256k1_v0_7_0_ecdsa_signature_parse_der and
* rustsecp256k1_v0_7_0_ecdsa_signature_parse_compact).
*
* The supported violations are:
* - All numbers are parsed as nonnegative integers, even though X.609-0207
Expand Down Expand Up @@ -83,9 +83,9 @@ extern "C" {
* encoded numbers are out of range, signature validation with it is
* guaranteed to fail for every message and public key.
*/
int rustsecp256k1_v0_6_1_ecdsa_signature_parse_der_lax(
const rustsecp256k1_v0_6_1_context* ctx,
rustsecp256k1_v0_6_1_ecdsa_signature* sig,
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
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
Expand Down
Expand Up @@ -8,7 +8,7 @@

#include "lax_der_privatekey_parsing.h"

int ec_privkey_import_der(const rustsecp256k1_v0_6_1_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
int ec_privkey_import_der(const rustsecp256k1_v0_7_0_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
const unsigned char *end = privkey + privkeylen;
int lenb = 0;
int len = 0;
Expand Down Expand Up @@ -45,17 +45,17 @@ int ec_privkey_import_der(const rustsecp256k1_v0_6_1_context* ctx, unsigned char
return 0;
}
if (privkey[1]) memcpy(out32 + 32 - privkey[1], privkey + 2, privkey[1]);
if (!rustsecp256k1_v0_6_1_ec_seckey_verify(ctx, out32)) {
if (!rustsecp256k1_v0_7_0_ec_seckey_verify(ctx, out32)) {
memset(out32, 0, 32);
return 0;
}
return 1;
}

int ec_privkey_export_der(const rustsecp256k1_v0_6_1_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
rustsecp256k1_v0_6_1_pubkey pubkey;
int ec_privkey_export_der(const rustsecp256k1_v0_7_0_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
rustsecp256k1_v0_7_0_pubkey pubkey;
size_t pubkeylen = 0;
if (!rustsecp256k1_v0_6_1_ec_pubkey_create(ctx, &pubkey, key32)) {
if (!rustsecp256k1_v0_7_0_ec_pubkey_create(ctx, &pubkey, key32)) {
*privkeylen = 0;
return 0;
}
Expand All @@ -79,7 +79,7 @@ int ec_privkey_export_der(const rustsecp256k1_v0_6_1_context *ctx, unsigned char
memcpy(ptr, key32, 32); ptr += 32;
memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
pubkeylen = 33;
rustsecp256k1_v0_6_1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
rustsecp256k1_v0_7_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
ptr += pubkeylen;
*privkeylen = ptr - privkey;
} else {
Expand All @@ -104,7 +104,7 @@ int ec_privkey_export_der(const rustsecp256k1_v0_6_1_context *ctx, unsigned char
memcpy(ptr, key32, 32); ptr += 32;
memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
pubkeylen = 65;
rustsecp256k1_v0_6_1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
rustsecp256k1_v0_7_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
ptr += pubkeylen;
*privkeylen = ptr - privkey;
}
Expand Down
Expand Up @@ -58,10 +58,10 @@ extern "C" {
* simple 32-byte private keys are sufficient.
*
* Note that this function does not guarantee correct DER output. It is
* guaranteed to be parsable by rustsecp256k1_v0_6_1_ec_privkey_import_der
* guaranteed to be parsable by rustsecp256k1_v0_7_0_ec_privkey_import_der
*/
SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
const rustsecp256k1_v0_6_1_context* ctx,
const rustsecp256k1_v0_7_0_context* ctx,
unsigned char *privkey,
size_t *privkeylen,
const unsigned char *seckey,
Expand All @@ -83,7 +83,7 @@ SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
* key.
*/
SECP256K1_WARN_UNUSED_RESULT int ec_privkey_import_der(
const rustsecp256k1_v0_6_1_context* ctx,
const rustsecp256k1_v0_7_0_context* ctx,
unsigned char *seckey,
const unsigned char *privkey,
size_t privkeylen
Expand Down

0 comments on commit 3fa2436

Please sign in to comment.