Skip to content

Commit 5e1e012

Browse files
committed
Merge #490: secp-sys: change symbol names to 0_6_1 from 0_5_0
91f1096 secp-sys: change symbol names to `0_6_1` from `0_5_0` (Andrew Poelstra) Pull request description: Needed to build secp-sys 0.5 and secp-sys 0.6 in the same tree. Fixes #489. This PR can be reproduced by running ./vendor-libsecp.sh depend/ 0_6_1 a1102b1 in the secp256k1-sys directory. ACKs for top commit: elichai: tACK 91f1096 Tree-SHA512: 0ce5149c9c4b7b44592dec84f1a6348f62437e679c15300efe0e2cc55ced5746e6061c596c83e18428841efb7df07c5cb443a0fd81800dc2a05da9a4f7a07c1a
2 parents b00b194 + 91f1096 commit 5e1e012

File tree

97 files changed

+5691
-5691
lines changed

Some content is hidden

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

97 files changed

+5691
-5691
lines changed

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.6.0"
3+
version = "0.6.1"
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_5_0"
15+
links = "rustsecp256k1_v0_6_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: 11 additions & 11 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_5_0_preallocated.h
11+
include_HEADERS += include/rustsecp256k1_v0_6_1_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_5_0_precomputed.la
67+
PRECOMPUTED_LIB = librustsecp256k1_v0_6_1_precomputed.la
6868
noinst_LTLIBRARIES = $(PRECOMPUTED_LIB)
69-
librustsecp256k1_v0_5_0_precomputed_la_SOURCES = src/precomputed_ecmult.c src/precomputed_ecmult_gen.c
70-
librustsecp256k1_v0_5_0_precomputed_la_CPPFLAGS = $(SECP_INCLUDES)
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)
7171

7272
if USE_EXTERNAL_ASM
73-
COMMON_LIB = librustsecp256k1_v0_5_0_common.la
73+
COMMON_LIB = librustsecp256k1_v0_6_1_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_5_0_common_la_SOURCES = src/asm/field_10x26_arm.s
84+
librustsecp256k1_v0_6_1_common_la_SOURCES = src/asm/field_10x26_arm.s
8585
endif
8686
endif
8787

88-
librustsecp256k1_v0_5_0_la_SOURCES = src/secp256k1.c
89-
librustsecp256k1_v0_5_0_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
90-
librustsecp256k1_v0_5_0_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB) $(PRECOMPUTED_LIB)
91-
librustsecp256k1_v0_5_0_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_CURRENT):$(LIB_VERSION_REVISION):$(LIB_VERSION_AGE)
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)
9292

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

9797
noinst_PROGRAMS =

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_5_0_ecdsa_signature_parse_der_lax(const rustsecp256k1_v0_5_0_context* ctx, rustsecp256k1_v0_5_0_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
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) {
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_5_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
19+
rustsecp256k1_v0_6_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_5_0_ecdsa_signature_parse_der_lax(const rustsecp256k1_v0_5_
137137
}
138138

139139
if (!overflow) {
140-
overflow = !rustsecp256k1_v0_5_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
140+
overflow = !rustsecp256k1_v0_6_1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
141141
}
142142
if (overflow) {
143143
memset(tmpsig, 0, 64);
144-
rustsecp256k1_v0_5_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
144+
rustsecp256k1_v0_6_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_5_0_ecdsa_signature_parse_der and
30-
* rustsecp256k1_v0_5_0_ecdsa_signature_parse_compact).
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).
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_5_0_ecdsa_signature_parse_der_lax(
87-
const rustsecp256k1_v0_5_0_context* ctx,
88-
rustsecp256k1_v0_5_0_ecdsa_signature* sig,
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,
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_5_0_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
11+
int ec_privkey_import_der(const rustsecp256k1_v0_6_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_5_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_5_0_ec_seckey_verify(ctx, out32)) {
48+
if (!rustsecp256k1_v0_6_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_5_0_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
56-
rustsecp256k1_v0_5_0_pubkey pubkey;
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;
5757
size_t pubkeylen = 0;
58-
if (!rustsecp256k1_v0_5_0_ec_pubkey_create(ctx, &pubkey, key32)) {
58+
if (!rustsecp256k1_v0_6_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_5_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_5_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
82+
rustsecp256k1_v0_6_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_5_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_5_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
107+
rustsecp256k1_v0_6_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: 3 additions & 3 deletions
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_5_0_ec_privkey_import_der
61+
* guaranteed to be parsable by rustsecp256k1_v0_6_1_ec_privkey_import_der
6262
*/
6363
SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
64-
const rustsecp256k1_v0_5_0_context* ctx,
64+
const rustsecp256k1_v0_6_1_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_5_0_context* ctx,
86+
const rustsecp256k1_v0_6_1_context* ctx,
8787
unsigned char *seckey,
8888
const unsigned char *privkey,
8989
size_t privkeylen

0 commit comments

Comments
 (0)