Skip to content

Commit 5ae136d

Browse files
committed
Bump secp256k1-sys version to 0.8.1
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.8.1 do: - Rename symbols to from `0_8_0` -> `0_8_1`, done mechanically (search and replace) - Add changes log notes (includes changelog entry for 0.8.0) - Bump `secp256k1-sys` crate version 0.8.0 -> 0.8.1, justified because we have added a new public function.
1 parent 1432fd1 commit 5ae136d

File tree

107 files changed

+6223
-6215
lines changed

Some content is hidden

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

107 files changed

+6223
-6215
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
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.8.0", default-features = false, path = "./secp256k1-sys" }
40+
secp256k1-sys = { version = "0.8.1", 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

secp256k1-sys/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 0.8.1 - 2023-13-16
2+
3+
* [Implement `insecure-erase`](https://github.com/rust-bitcoin/rust-secp256k1/pull/582).
4+
5+
# 0.8.0 - 2202-12-19
6+
7+
* Update libsecp25k1 to v0.2.0
8+
19
# 0.7.0 - 2022-12-01
210

311
* [Make comparison functions stable across library versions](https://github.com/rust-bitcoin/rust-secp256k1/pull/518)

secp256k1-sys/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1-sys"
3-
version = "0.8.0"
3+
version = "0.8.1"
44
authors = [ "Dawid Ciężarkiewicz <dpc@ucore.info>",
55
"Andrew Poelstra <apoelstra@wpsoftware.net>",
66
"Steven Roose <steven@stevenroose.org>" ]
@@ -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_8_0"
15+
links = "rustsecp256k1_v0_8_1"
1616
edition = "2018"
1717

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

secp256k1-sys/depend/secp256k1/Makefile.am

Lines changed: 12 additions & 12 deletions
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_8_0_preallocated.h
11+
include_HEADERS += include/rustsecp256k1_v0_8_1_preallocated.h
1212
noinst_HEADERS =
1313
noinst_HEADERS += src/scalar.h
1414
noinst_HEADERS += src/scalar_4x64.h
@@ -70,13 +70,13 @@ noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
7070
noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
7171
noinst_HEADERS += examples/random.h
7272

73-
PRECOMPUTED_LIB = librustsecp256k1_v0_8_0_precomputed.la
73+
PRECOMPUTED_LIB = librustsecp256k1_v0_8_1_precomputed.la
7474
noinst_LTLIBRARIES = $(PRECOMPUTED_LIB)
75-
librustsecp256k1_v0_8_0_precomputed_la_SOURCES = src/precomputed_ecmult.c src/precomputed_ecmult_gen.c
76-
librustsecp256k1_v0_8_0_precomputed_la_CPPFLAGS = $(SECP_INCLUDES)
75+
librustsecp256k1_v0_8_1_precomputed_la_SOURCES = src/precomputed_ecmult.c src/precomputed_ecmult_gen.c
76+
librustsecp256k1_v0_8_1_precomputed_la_CPPFLAGS = $(SECP_INCLUDES)
7777

7878
if USE_EXTERNAL_ASM
79-
COMMON_LIB = librustsecp256k1_v0_8_0_common.la
79+
COMMON_LIB = librustsecp256k1_v0_8_1_common.la
8080
else
8181
COMMON_LIB =
8282
endif
@@ -87,17 +87,17 @@ pkgconfig_DATA = libsecp256k1.pc
8787

8888
if USE_EXTERNAL_ASM
8989
if USE_ASM_ARM
90-
librustsecp256k1_v0_8_0_common_la_SOURCES = src/asm/field_10x26_arm.s
90+
librustsecp256k1_v0_8_1_common_la_SOURCES = src/asm/field_10x26_arm.s
9191
endif
9292
endif
9393

94-
librustsecp256k1_v0_8_0_la_SOURCES = src/secp256k1.c
95-
librustsecp256k1_v0_8_0_la_CPPFLAGS = $(SECP_INCLUDES)
96-
librustsecp256k1_v0_8_0_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
97-
librustsecp256k1_v0_8_0_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_CURRENT):$(LIB_VERSION_REVISION):$(LIB_VERSION_AGE)
94+
librustsecp256k1_v0_8_1_la_SOURCES = src/secp256k1.c
95+
librustsecp256k1_v0_8_1_la_CPPFLAGS = $(SECP_INCLUDES)
96+
librustsecp256k1_v0_8_1_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
97+
librustsecp256k1_v0_8_1_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_CURRENT):$(LIB_VERSION_REVISION):$(LIB_VERSION_AGE)
9898

9999
if VALGRIND_ENABLED
100-
librustsecp256k1_v0_8_0_la_CPPFLAGS += -DVALGRIND
100+
librustsecp256k1_v0_8_1_la_CPPFLAGS += -DVALGRIND
101101
endif
102102

103103
noinst_PROGRAMS =
@@ -223,7 +223,7 @@ EXTRA_DIST += sage/gen_exhaustive_groups.sage
223223
EXTRA_DIST += sage/gen_split_lambda_constants.sage
224224
EXTRA_DIST += sage/group_prover.sage
225225
EXTRA_DIST += sage/prove_group_implementations.sage
226-
EXTRA_DIST += sage/rustsecp256k1_v0_8_0_params.sage
226+
EXTRA_DIST += sage/rustsecp256k1_v0_8_1_params.sage
227227
EXTRA_DIST += sage/weierstrass_prover.sage
228228

229229
if ENABLE_MODULE_ECDH

secp256k1-sys/depend/secp256k1/contrib/lax_der_parsing.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
#include "lax_der_parsing.h"
1010

11-
int rustsecp256k1_v0_8_0_ecdsa_signature_parse_der_lax(const rustsecp256k1_v0_8_0_context* ctx, rustsecp256k1_v0_8_0_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
11+
int rustsecp256k1_v0_8_1_ecdsa_signature_parse_der_lax(const rustsecp256k1_v0_8_1_context* ctx, rustsecp256k1_v0_8_1_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_8_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
19+
rustsecp256k1_v0_8_1_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_8_0_ecdsa_signature_parse_der_lax(const rustsecp256k1_v0_8_
137137
}
138138

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

secp256k1-sys/depend/secp256k1/contrib/lax_der_parsing.h

Lines changed: 5 additions & 5 deletions
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_8_0_ecdsa_signature_parse_der and
30-
* rustsecp256k1_v0_8_0_ecdsa_signature_parse_compact).
29+
* instead if you have the choice (see rustsecp256k1_v0_8_1_ecdsa_signature_parse_der and
30+
* rustsecp256k1_v0_8_1_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_8_0_ecdsa_signature_parse_der_lax(
87-
const rustsecp256k1_v0_8_0_context* ctx,
88-
rustsecp256k1_v0_8_0_ecdsa_signature* sig,
86+
int rustsecp256k1_v0_8_1_ecdsa_signature_parse_der_lax(
87+
const rustsecp256k1_v0_8_1_context* ctx,
88+
rustsecp256k1_v0_8_1_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);

secp256k1-sys/depend/secp256k1/contrib/lax_der_privatekey_parsing.c

Lines changed: 7 additions & 7 deletions
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_8_0_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
11+
int ec_privkey_import_der(const rustsecp256k1_v0_8_1_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_8_0_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_8_0_ec_seckey_verify(ctx, out32)) {
48+
if (!rustsecp256k1_v0_8_1_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_8_0_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
56-
rustsecp256k1_v0_8_0_pubkey pubkey;
55+
int ec_privkey_export_der(const rustsecp256k1_v0_8_1_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
56+
rustsecp256k1_v0_8_1_pubkey pubkey;
5757
size_t pubkeylen = 0;
58-
if (!rustsecp256k1_v0_8_0_ec_pubkey_create(ctx, &pubkey, key32)) {
58+
if (!rustsecp256k1_v0_8_1_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_8_0_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_8_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
82+
rustsecp256k1_v0_8_1_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_8_0_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_8_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
107+
rustsecp256k1_v0_8_1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
108108
ptr += pubkeylen;
109109
*privkeylen = ptr - privkey;
110110
}

secp256k1-sys/depend/secp256k1/contrib/lax_der_privatekey_parsing.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extern "C" {
4343
/** Export a private key in DER format.
4444
*
4545
* Returns: 1 if the private key was valid.
46-
* Args: ctx: pointer to a context object (not rustsecp256k1_v0_8_0_context_static).
46+
* Args: ctx: pointer to a context object (not rustsecp256k1_v0_8_1_context_static).
4747
* Out: privkey: pointer to an array for storing the private key in BER.
4848
* Should have space for 279 bytes, and cannot be NULL.
4949
* privkeylen: Pointer to an int where the length of the private key in
@@ -57,10 +57,10 @@ extern "C" {
5757
* simple 32-byte private keys are sufficient.
5858
*
5959
* Note that this function does not guarantee correct DER output. It is
60-
* guaranteed to be parsable by rustsecp256k1_v0_8_0_ec_privkey_import_der
60+
* guaranteed to be parsable by rustsecp256k1_v0_8_1_ec_privkey_import_der
6161
*/
6262
SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
63-
const rustsecp256k1_v0_8_0_context* ctx,
63+
const rustsecp256k1_v0_8_1_context* ctx,
6464
unsigned char *privkey,
6565
size_t *privkeylen,
6666
const unsigned char *seckey,
@@ -82,7 +82,7 @@ SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
8282
* key.
8383
*/
8484
SECP256K1_WARN_UNUSED_RESULT int ec_privkey_import_der(
85-
const rustsecp256k1_v0_8_0_context* ctx,
85+
const rustsecp256k1_v0_8_1_context* ctx,
8686
unsigned char *seckey,
8787
const unsigned char *privkey,
8888
size_t privkeylen

secp256k1-sys/depend/secp256k1/examples/ecdh.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ int main(void) {
2727
unsigned char randomize[32];
2828
int return_val;
2929
size_t len;
30-
rustsecp256k1_v0_8_0_pubkey pubkey1;
31-
rustsecp256k1_v0_8_0_pubkey pubkey2;
30+
rustsecp256k1_v0_8_1_pubkey pubkey1;
31+
rustsecp256k1_v0_8_1_pubkey pubkey2;
3232

3333
/* Before we can call actual API functions, we need to create a "context". */
34-
rustsecp256k1_v0_8_0_context* ctx = rustsecp256k1_v0_8_0_context_create(SECP256K1_CONTEXT_NONE);
34+
rustsecp256k1_v0_8_1_context* ctx = rustsecp256k1_v0_8_1_context_create(SECP256K1_CONTEXT_NONE);
3535
if (!fill_random(randomize, sizeof(randomize))) {
3636
printf("Failed to generate randomness\n");
3737
return 1;
3838
}
3939
/* Randomizing the context is recommended to protect against side-channel
40-
* leakage See `rustsecp256k1_v0_8_0_context_randomize` in secp256k1.h for more
40+
* leakage See `rustsecp256k1_v0_8_1_context_randomize` in secp256k1.h for more
4141
* information about it. This should never fail. */
42-
return_val = rustsecp256k1_v0_8_0_context_randomize(ctx, randomize);
42+
return_val = rustsecp256k1_v0_8_1_context_randomize(ctx, randomize);
4343
assert(return_val);
4444

4545
/*** Key Generation ***/
@@ -52,27 +52,27 @@ int main(void) {
5252
printf("Failed to generate randomness\n");
5353
return 1;
5454
}
55-
if (rustsecp256k1_v0_8_0_ec_seckey_verify(ctx, seckey1) && rustsecp256k1_v0_8_0_ec_seckey_verify(ctx, seckey2)) {
55+
if (rustsecp256k1_v0_8_1_ec_seckey_verify(ctx, seckey1) && rustsecp256k1_v0_8_1_ec_seckey_verify(ctx, seckey2)) {
5656
break;
5757
}
5858
}
5959

6060
/* Public key creation using a valid context with a verified secret key should never fail */
61-
return_val = rustsecp256k1_v0_8_0_ec_pubkey_create(ctx, &pubkey1, seckey1);
61+
return_val = rustsecp256k1_v0_8_1_ec_pubkey_create(ctx, &pubkey1, seckey1);
6262
assert(return_val);
63-
return_val = rustsecp256k1_v0_8_0_ec_pubkey_create(ctx, &pubkey2, seckey2);
63+
return_val = rustsecp256k1_v0_8_1_ec_pubkey_create(ctx, &pubkey2, seckey2);
6464
assert(return_val);
6565

6666
/* Serialize pubkey1 in a compressed form (33 bytes), should always return 1 */
6767
len = sizeof(compressed_pubkey1);
68-
return_val = rustsecp256k1_v0_8_0_ec_pubkey_serialize(ctx, compressed_pubkey1, &len, &pubkey1, SECP256K1_EC_COMPRESSED);
68+
return_val = rustsecp256k1_v0_8_1_ec_pubkey_serialize(ctx, compressed_pubkey1, &len, &pubkey1, SECP256K1_EC_COMPRESSED);
6969
assert(return_val);
7070
/* Should be the same size as the size of the output, because we passed a 33 byte array. */
7171
assert(len == sizeof(compressed_pubkey1));
7272

7373
/* Serialize pubkey2 in a compressed form (33 bytes) */
7474
len = sizeof(compressed_pubkey2);
75-
return_val = rustsecp256k1_v0_8_0_ec_pubkey_serialize(ctx, compressed_pubkey2, &len, &pubkey2, SECP256K1_EC_COMPRESSED);
75+
return_val = rustsecp256k1_v0_8_1_ec_pubkey_serialize(ctx, compressed_pubkey2, &len, &pubkey2, SECP256K1_EC_COMPRESSED);
7676
assert(return_val);
7777
/* Should be the same size as the size of the output, because we passed a 33 byte array. */
7878
assert(len == sizeof(compressed_pubkey2));
@@ -81,12 +81,12 @@ int main(void) {
8181

8282
/* Perform ECDH with seckey1 and pubkey2. Should never fail with a verified
8383
* seckey and valid pubkey */
84-
return_val = rustsecp256k1_v0_8_0_ecdh(ctx, shared_secret1, &pubkey2, seckey1, NULL, NULL);
84+
return_val = rustsecp256k1_v0_8_1_ecdh(ctx, shared_secret1, &pubkey2, seckey1, NULL, NULL);
8585
assert(return_val);
8686

8787
/* Perform ECDH with seckey2 and pubkey1. Should never fail with a verified
8888
* seckey and valid pubkey */
89-
return_val = rustsecp256k1_v0_8_0_ecdh(ctx, shared_secret2, &pubkey1, seckey2, NULL, NULL);
89+
return_val = rustsecp256k1_v0_8_1_ecdh(ctx, shared_secret2, &pubkey1, seckey2, NULL, NULL);
9090
assert(return_val);
9191

9292
/* Both parties should end up with the same shared secret */
@@ -105,7 +105,7 @@ int main(void) {
105105
print_hex(shared_secret1, sizeof(shared_secret1));
106106

107107
/* This will clear everything from the context and free the memory */
108-
rustsecp256k1_v0_8_0_context_destroy(ctx);
108+
rustsecp256k1_v0_8_1_context_destroy(ctx);
109109

110110
/* It's best practice to try to clear secrets from memory after using them.
111111
* This is done because some bugs can allow an attacker to leak memory, for

0 commit comments

Comments
 (0)