Skip to content

Commit 5d49c85

Browse files
committed
Merge #42: Prepare for -sys release 0.5.0
cdba7dc Prepare for -sys release 0.5.0 (Jonas Nick) Pull request description: Top commit has no ACKs. Tree-SHA512: 5e766be36d0a27e9419be7ab81d53cb1d8d49c4da3e61d146b7cd0d74b159ad41a36c293bf48cdf228ef4f23d0caa439b8866f1784cd8eb69211799acf96c7d8
2 parents c5a074a + cdba7dc commit 5d49c85

File tree

134 files changed

+8537
-8537
lines changed

Some content is hidden

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

134 files changed

+8537
-8537
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use-rand = ["rand", "secp256k1/rand"]
3131

3232
[dependencies]
3333
secp256k1 = "0.20.0"
34-
secp256k1-zkp-sys = { version = "0.4.0", default-features = false, path = "./secp256k1-zkp-sys" }
34+
secp256k1-zkp-sys = { version = "0.5.0", default-features = false, path = "./secp256k1-zkp-sys" }
3535
rand = { version = "0.6", default-features = false, optional = true }
3636
serde = { version = "1.0", default-features = false, optional = true }
3737

secp256k1-zkp-sys/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1-zkp-sys"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
55
"Andrew Poelstra <[email protected]>",
66
"Steven Roose <[email protected]>",
@@ -13,7 +13,7 @@ description = "FFI for `libsecp256k1-zkp` library."
1313
keywords = [ "secp256k1", "libsecp256k1-zkp", "ffi" ]
1414
readme = "README.md"
1515
build = "build.rs"
16-
links = "rustsecp256k1zkp_v0_4_0"
16+
links = "rustsecp256k1zkp_v0_5_0"
1717

1818
# Should make docs.rs show all functions, even those behind non-default features
1919
[package.metadata.docs.rs]

secp256k1-zkp-sys/depend/secp256k1/Makefile.am

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I build-aux/m4
22

33
lib_LTLIBRARIES = libsecp256k1.la
44
include_HEADERS = include/secp256k1.h
5-
include_HEADERS += include/rustsecp256k1zkp_v0_4_0_preallocated.h
5+
include_HEADERS += include/rustsecp256k1zkp_v0_5_0_preallocated.h
66
noinst_HEADERS =
77
noinst_HEADERS += src/scalar.h
88
noinst_HEADERS += src/scalar_4x64.h
@@ -54,7 +54,7 @@ noinst_HEADERS += contrib/lax_der_privatekey_parsing.h
5454
noinst_HEADERS += contrib/lax_der_privatekey_parsing.c
5555

5656
if USE_EXTERNAL_ASM
57-
COMMON_LIB = librustsecp256k1zkp_v0_4_0_common.la
57+
COMMON_LIB = librustsecp256k1zkp_v0_5_0_common.la
5858
noinst_LTLIBRARIES = $(COMMON_LIB)
5959
else
6060
COMMON_LIB =
@@ -65,16 +65,16 @@ pkgconfig_DATA = libsecp256k1.pc
6565

6666
if USE_EXTERNAL_ASM
6767
if USE_ASM_ARM
68-
librustsecp256k1zkp_v0_4_0_common_la_SOURCES = src/asm/field_10x26_arm.s
68+
librustsecp256k1zkp_v0_5_0_common_la_SOURCES = src/asm/field_10x26_arm.s
6969
endif
7070
endif
7171

72-
librustsecp256k1zkp_v0_4_0_la_SOURCES = src/secp256k1.c
73-
librustsecp256k1zkp_v0_4_0_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
74-
librustsecp256k1zkp_v0_4_0_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB)
72+
librustsecp256k1zkp_v0_5_0_la_SOURCES = src/secp256k1.c
73+
librustsecp256k1zkp_v0_5_0_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)
74+
librustsecp256k1zkp_v0_5_0_la_LIBADD = $(SECP_LIBS) $(COMMON_LIB)
7575

7676
if VALGRIND_ENABLED
77-
librustsecp256k1zkp_v0_4_0_la_CPPFLAGS += -DVALGRIND
77+
librustsecp256k1zkp_v0_5_0_la_CPPFLAGS += -DVALGRIND
7878
endif
7979

8080
noinst_PROGRAMS =
@@ -136,7 +136,7 @@ gen_%.o: src/gen_%.c src/libsecp256k1-config.h
136136
$(gen_context_BIN): $(gen_context_OBJECTS)
137137
$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $^ -o $@
138138

139-
$(librustsecp256k1zkp_v0_4_0_la_OBJECTS): src/ecmult_static_context.h
139+
$(librustsecp256k1zkp_v0_5_0_la_OBJECTS): src/ecmult_static_context.h
140140
$(tests_OBJECTS): src/ecmult_static_context.h
141141
$(bench_internal_OBJECTS): src/ecmult_static_context.h
142142
$(bench_ecmult_OBJECTS): src/ecmult_static_context.h

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
#include "lax_der_parsing.h"
1111

12-
int rustsecp256k1zkp_v0_4_0_ecdsa_signature_parse_der_lax(const rustsecp256k1zkp_v0_4_0_context* ctx, rustsecp256k1zkp_v0_4_0_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
12+
int rustsecp256k1zkp_v0_5_0_ecdsa_signature_parse_der_lax(const rustsecp256k1zkp_v0_5_0_context* ctx, rustsecp256k1zkp_v0_5_0_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
1313
size_t rpos, rlen, spos, slen;
1414
size_t pos = 0;
1515
size_t lenbyte;
1616
unsigned char tmpsig[64] = {0};
1717
int overflow = 0;
1818

1919
/* Hack to initialize sig with a correctly-parsed but invalid signature. */
20-
rustsecp256k1zkp_v0_4_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
20+
rustsecp256k1zkp_v0_5_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
2121

2222
/* Sequence tag byte */
2323
if (pos == inputlen || input[pos] != 0x30) {
@@ -138,11 +138,11 @@ int rustsecp256k1zkp_v0_4_0_ecdsa_signature_parse_der_lax(const rustsecp256k1zkp
138138
}
139139

140140
if (!overflow) {
141-
overflow = !rustsecp256k1zkp_v0_4_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
141+
overflow = !rustsecp256k1zkp_v0_5_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
142142
}
143143
if (overflow) {
144144
memset(tmpsig, 0, 64);
145-
rustsecp256k1zkp_v0_4_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
145+
rustsecp256k1zkp_v0_5_0_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
146146
}
147147
return 1;
148148
}

secp256k1-zkp-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 rustsecp256k1zkp_v0_4_0_ecdsa_signature_parse_der and
30-
* rustsecp256k1zkp_v0_4_0_ecdsa_signature_parse_compact).
29+
* instead if you have the choice (see rustsecp256k1zkp_v0_5_0_ecdsa_signature_parse_der and
30+
* rustsecp256k1zkp_v0_5_0_ecdsa_signature_parse_compact).
3131
*
3232
* The supported violations are:
3333
* - All numbers are parsed as nonnegative integers, even though X.609-0207
@@ -77,9 +77,9 @@ extern "C" {
7777
* encoded numbers are out of range, signature validation with it is
7878
* guaranteed to fail for every message and public key.
7979
*/
80-
int rustsecp256k1zkp_v0_4_0_ecdsa_signature_parse_der_lax(
81-
const rustsecp256k1zkp_v0_4_0_context* ctx,
82-
rustsecp256k1zkp_v0_4_0_ecdsa_signature* sig,
80+
int rustsecp256k1zkp_v0_5_0_ecdsa_signature_parse_der_lax(
81+
const rustsecp256k1zkp_v0_5_0_context* ctx,
82+
rustsecp256k1zkp_v0_5_0_ecdsa_signature* sig,
8383
const unsigned char *input,
8484
size_t inputlen
8585
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "lax_der_privatekey_parsing.h"
1111

12-
int ec_privkey_import_der(const rustsecp256k1zkp_v0_4_0_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
12+
int ec_privkey_import_der(const rustsecp256k1zkp_v0_5_0_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
1313
const unsigned char *end = privkey + privkeylen;
1414
int lenb = 0;
1515
int len = 0;
@@ -46,17 +46,17 @@ int ec_privkey_import_der(const rustsecp256k1zkp_v0_4_0_context* ctx, unsigned c
4646
return 0;
4747
}
4848
memcpy(out32 + 32 - privkey[1], privkey + 2, privkey[1]);
49-
if (!rustsecp256k1zkp_v0_4_0_ec_seckey_verify(ctx, out32)) {
49+
if (!rustsecp256k1zkp_v0_5_0_ec_seckey_verify(ctx, out32)) {
5050
memset(out32, 0, 32);
5151
return 0;
5252
}
5353
return 1;
5454
}
5555

56-
int ec_privkey_export_der(const rustsecp256k1zkp_v0_4_0_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
57-
rustsecp256k1zkp_v0_4_0_pubkey pubkey;
56+
int ec_privkey_export_der(const rustsecp256k1zkp_v0_5_0_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
57+
rustsecp256k1zkp_v0_5_0_pubkey pubkey;
5858
size_t pubkeylen = 0;
59-
if (!rustsecp256k1zkp_v0_4_0_ec_pubkey_create(ctx, &pubkey, key32)) {
59+
if (!rustsecp256k1zkp_v0_5_0_ec_pubkey_create(ctx, &pubkey, key32)) {
6060
*privkeylen = 0;
6161
return 0;
6262
}
@@ -80,7 +80,7 @@ int ec_privkey_export_der(const rustsecp256k1zkp_v0_4_0_context *ctx, unsigned c
8080
memcpy(ptr, key32, 32); ptr += 32;
8181
memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
8282
pubkeylen = 33;
83-
rustsecp256k1zkp_v0_4_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
83+
rustsecp256k1zkp_v0_5_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
8484
ptr += pubkeylen;
8585
*privkeylen = ptr - privkey;
8686
} else {
@@ -105,7 +105,7 @@ int ec_privkey_export_der(const rustsecp256k1zkp_v0_4_0_context *ctx, unsigned c
105105
memcpy(ptr, key32, 32); ptr += 32;
106106
memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
107107
pubkeylen = 65;
108-
rustsecp256k1zkp_v0_4_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
108+
rustsecp256k1zkp_v0_5_0_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
109109
ptr += pubkeylen;
110110
*privkeylen = ptr - privkey;
111111
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ extern "C" {
5252
* simple 32-byte private keys are sufficient.
5353
*
5454
* Note that this function does not guarantee correct DER output. It is
55-
* guaranteed to be parsable by rustsecp256k1zkp_v0_4_0_ec_privkey_import_der
55+
* guaranteed to be parsable by rustsecp256k1zkp_v0_5_0_ec_privkey_import_der
5656
*/
5757
SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
58-
const rustsecp256k1zkp_v0_4_0_context* ctx,
58+
const rustsecp256k1zkp_v0_5_0_context* ctx,
5959
unsigned char *privkey,
6060
size_t *privkeylen,
6161
const unsigned char *seckey,
@@ -77,7 +77,7 @@ SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
7777
* key.
7878
*/
7979
SECP256K1_WARN_UNUSED_RESULT int ec_privkey_import_der(
80-
const rustsecp256k1zkp_v0_4_0_context* ctx,
80+
const rustsecp256k1zkp_v0_5_0_context* ctx,
8181
unsigned char *seckey,
8282
const unsigned char *privkey,
8383
size_t privkeylen

0 commit comments

Comments
 (0)