From e2064866a0d4aeeddbfffde1d7dcf81fab4e2e1a Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 8 Aug 2023 11:56:26 +1000 Subject: [PATCH 01/14] CI: Update pins Pinning is broken again, update the pins it CI so that the following sequence of commands would work ```bash rm Cargo.lock cargo +1.48 update -p wasm-bindgen-test --precise 0.3.34 cargo +1.48 update -p serde_test --precise 1.0.175 cargo +1.48 test --all-features ``` Note, solely out of interest, `cargo +1.48 build` does not need pinning (at the moment :) --- contrib/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/test.sh b/contrib/test.sh index e76c193fd..1ee60da65 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -16,7 +16,7 @@ fi # Pin dependencies as required if we are using MSRV toolchain. if cargo --version | grep "1\.48"; then cargo update -p wasm-bindgen-test --precise 0.3.34 - cargo update -p serde --precise 1.0.156 + cargo update -p serde_test --precise 1.0.175 fi # Test if panic in C code aborts the process (either with a real panic or with SIGILL) From b1b0bc85e2272ed882b22c34ce9029cb8cfc9b05 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 8 Aug 2023 11:40:24 +1000 Subject: [PATCH 02/14] CI: Grep for exact error message `cargo +nightly` output of panic recently changed breaking our grep statement by adding the code line and a newline. Grep for the exact second line of the error message. --- contrib/test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/test.sh b/contrib/test.sh index 1ee60da65..13c216c2f 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -20,7 +20,9 @@ if cargo --version | grep "1\.48"; then fi # Test if panic in C code aborts the process (either with a real panic or with SIGILL) -cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 | tee /dev/stderr | grep "SIGILL\\|panicked at '\[libsecp256k1\]" +cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 \ + | tee /dev/stderr \ + | grep "SIGILL\\|\[libsecp256k1] illegal argument. !rustsecp256k1_v0_._._fe_is_zero(&ge->x)" # Make all cargo invocations verbose export CARGO_TERM_VERBOSE=true From 2069c664649b280c135fc84f2ce683cb0b831481 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 8 Aug 2023 12:23:01 +1000 Subject: [PATCH 03/14] no_std_test: Remove internal_features Remove the `internal_features` attribute, not sure what it was supposed to be doing but the crate works without it. --- no_std_test/src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/no_std_test/src/main.rs b/no_std_test/src/main.rs index d98276c67..2e2a3bd62 100644 --- a/no_std_test/src/main.rs +++ b/no_std_test/src/main.rs @@ -27,7 +27,6 @@ //! * Requires linking with `libc` for calling `printf`. //! -#![feature(lang_items)] #![feature(start)] #![feature(core_intrinsics)] #![feature(panic_info_message)] From 8a5e16562ed844f21f52c965589ee2253fd2c7e0 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 8 Aug 2023 12:24:24 +1000 Subject: [PATCH 04/14] Allow stuff after unconditional panic We have an unconditional panic for some combination of features, this causes clippy to give a bunch of useless warnings. Add allow attributes to quieten down clippy. --- src/key.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/key.rs b/src/key.rs index 0eb747e55..1791dc191 100644 --- a/src/key.rs +++ b/src/key.rs @@ -1036,6 +1036,8 @@ impl serde::Serialize for KeyPair { } #[cfg(feature = "serde")] +#[allow(unused_variables)] // For `data` under some feature combinations (the unconditional panic below). +#[allow(unreachable_code)] // For `KeyPair::from_seckey_slice` after unconditional panic. impl<'de> serde::Deserialize<'de> for KeyPair { fn deserialize>(d: D) -> Result { if d.is_human_readable() { From 253ebe8186b906ba29355ea2e10b7fb2ff84d184 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 8 Aug 2023 12:23:33 +1000 Subject: [PATCH 05/14] Target panic message at lib users Currently the panic message refers to stuff related to development of the library, this is meaningless for users of the lib. Target panic message at secp users instead. --- src/key.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/key.rs b/src/key.rs index 1791dc191..ecec1796f 100644 --- a/src/key.rs +++ b/src/key.rs @@ -1053,7 +1053,7 @@ impl<'de> serde::Deserialize<'de> for KeyPair { let ctx = Secp256k1::signing_only(); #[cfg(not(any(feature = "global-context", feature = "alloc")))] - let ctx: Secp256k1 = panic!("The previous implementation was panicking too, please enable the global-context feature of rust-secp256k1"); + let ctx: Secp256k1 = panic!("cannot deserialize key pair without a context (please enable either the global-context or alloc feature)"); #[allow(clippy::needless_borrow)] KeyPair::from_seckey_slice(&ctx, data) From 28489ecc1d490aadba37db8d0daafe6d47af027e Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 20 Jul 2023 10:52:26 +1000 Subject: [PATCH 06/14] Remove trailing whitespace --- contrib/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/test.sh b/contrib/test.sh index 13c216c2f..636db3d5e 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -50,7 +50,7 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then cargo build --all --no-default-features --features="std,$feature" cargo test --all --no-default-features --features="std,$feature" done - # Other combos + # Other combos RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all --features="$FEATURES" cargo test --all --features="rand serde" From ca013fed6d99b5e6ead99b9de4344fe263d354f9 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 21 Jul 2023 11:06:21 +1000 Subject: [PATCH 07/14] Move recent/minimal lock files A while back we added two lock files that were to track dependencies of two successful test runs, one with a minimal set of dependencies and one with a recent set of dependencies (ie, recent dependency versions). We never used these lock files in CI however. In preparation for using the lock files in CI, and in order to be uniform with `rust-bitcoin`, move the lock files to the crate root and rename them to: - Cargo-minimal.lock - Cargo-recent.lock --- contrib/Cargo.minimal.lock => Cargo-minimal.lock | 0 contrib/Cargo.latest.lock => Cargo-recent.lock | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename contrib/Cargo.minimal.lock => Cargo-minimal.lock (100%) rename contrib/Cargo.latest.lock => Cargo-recent.lock (100%) diff --git a/contrib/Cargo.minimal.lock b/Cargo-minimal.lock similarity index 100% rename from contrib/Cargo.minimal.lock rename to Cargo-minimal.lock diff --git a/contrib/Cargo.latest.lock b/Cargo-recent.lock similarity index 100% rename from contrib/Cargo.latest.lock rename to Cargo-recent.lock From 8d4ae028aba5989e1d35d2529bec2838b38e59bc Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 20 Jul 2023 10:53:01 +1000 Subject: [PATCH 08/14] Add a layer of indirection to the test script We would like to be able to run the test script with different lock files, in preparation for doing so move the `test.sh` script to `_test.sh` and add a new `test.sh` that runs `_test.sh`. Keep the outer script as `test.sh` so that we do not change the workflow for those running the script including the github actions. --- contrib/_test.sh | 129 +++++++++++++++++++++++++++++++++++++++++++++++ contrib/test.sh | 128 +--------------------------------------------- 2 files changed, 131 insertions(+), 126 deletions(-) create mode 100755 contrib/_test.sh diff --git a/contrib/_test.sh b/contrib/_test.sh new file mode 100755 index 000000000..f2290674f --- /dev/null +++ b/contrib/_test.sh @@ -0,0 +1,129 @@ +#!/bin/sh + +set -ex + +FEATURES="bitcoin-hashes global-context lowmemory rand recovery serde std alloc bitcoin-hashes-std rand-std" + +cargo --version +rustc --version + +# Work out if we are using a nightly toolchain. +NIGHTLY=false +if cargo --version | grep nightly; then + NIGHTLY=true +fi + +# Pin dependencies as required if we are using MSRV toolchain. +if cargo --version | grep "1\.48"; then + cargo update -p wasm-bindgen-test --precise 0.3.34 + cargo update -p serde --precise 1.0.156 +fi + +# Test if panic in C code aborts the process (either with a real panic or with SIGILL) +cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 | tee /dev/stderr | grep "SIGILL\\|panicked at '\[libsecp256k1\]" + +# Make all cargo invocations verbose +export CARGO_TERM_VERBOSE=true + +# Defaults / sanity checks +cargo build --all +cargo test --all + +if [ "$DO_FEATURE_MATRIX" = true ]; then + cargo build --all --no-default-features + cargo test --all --no-default-features + + # All features + cargo build --all --no-default-features --features="$FEATURES" + cargo test --all --no-default-features --features="$FEATURES" + # Single features + for feature in ${FEATURES} + do + cargo build --all --no-default-features --features="$feature" + cargo test --all --no-default-features --features="$feature" + done + # Features tested with 'std' feature enabled. + for feature in ${FEATURES} + do + cargo build --all --no-default-features --features="std,$feature" + cargo test --all --no-default-features --features="std,$feature" + done + # Other combos + RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all + RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all --features="$FEATURES" + cargo test --all --features="rand serde" + + if [ "$NIGHTLY" = true ]; then + cargo test --all --all-features + RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all --all-features + fi + + # Examples + cargo run --example sign_verify --features=bitcoin-hashes-std + cargo run --example sign_verify_recovery --features=recovery,bitcoin-hashes-std + cargo run --example generate_keys --features=rand-std +fi + +if [ "$DO_LINT" = true ] +then + cargo clippy --all-features --all-targets -- -D warnings + cargo clippy --example sign_verify --features=bitcoin-hashes-std -- -D warnings + cargo clippy --example sign_verify_recovery --features=recovery,bitcoin-hashes-std -- -D warnings + cargo clippy --example generate_keys --features=rand-std -- -D warnings +fi + +# Build the docs if told to (this only works with the nightly toolchain) +if [ "$DO_DOCSRS" = true ]; then + RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +nightly doc --all-features +fi + +# Build the docs with a stable toolchain, in unison with the DO_DOCSRS command +# above this checks that we feature guarded docs imports correctly. +if [ "$DO_DOCS" = true ]; then + RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features +fi + +# Webassembly stuff +if [ "$DO_WASM" = true ]; then + clang --version + CARGO_TARGET_DIR=wasm cargo install --force wasm-pack + printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml + CC=clang wasm-pack build + CC=clang wasm-pack test --node +fi + +# Address Sanitizer +if [ "$DO_ASAN" = true ]; then + clang --version + cargo clean + CC='clang -fsanitize=address -fno-omit-frame-pointer' \ + RUSTFLAGS='-Zsanitizer=address -Clinker=clang -Cforce-frame-pointers=yes' \ + ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' \ + cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu + cargo clean + # The -Cllvm-args=-msan-eager-checks=0 flag was added to overcome this issue: + # https://github.com/rust-bitcoin/rust-secp256k1/pull/573#issuecomment-1399465995 + CC='clang -fsanitize=memory -fno-omit-frame-pointer' \ + RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins -Cforce-frame-pointers=yes -Cllvm-args=-msan-eager-checks=0' \ + cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu + cargo run --release --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified Successfully" + cargo run --release --features=alloc --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified alloc Successfully" +fi + +# Run formatter if told to. +if [ "$DO_FMT" = true ]; then + if [ "$NIGHTLY" = false ]; then + echo "DO_FMT requires a nightly toolchain (consider using RUSTUP_TOOLCHAIN)" + exit 1 + fi + rustup component add rustfmt + cargo fmt --check || exit 1 +fi + +# Bench if told to, only works with non-stable toolchain (nightly, beta). +if [ "$DO_BENCH" = true ] +then + RUSTFLAGS='--cfg=bench' cargo bench --features=recovery,rand-std +fi + +exit 0 diff --git a/contrib/test.sh b/contrib/test.sh index 636db3d5e..05b680c3c 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -2,130 +2,6 @@ set -ex -FEATURES="bitcoin-hashes global-context lowmemory rand recovery serde std alloc bitcoin-hashes-std rand-std" +REPO_DIR=$(git rev-parse --show-toplevel) -cargo --version -rustc --version - -# Work out if we are using a nightly toolchain. -NIGHTLY=false -if cargo --version | grep nightly; then - NIGHTLY=true -fi - -# Pin dependencies as required if we are using MSRV toolchain. -if cargo --version | grep "1\.48"; then - cargo update -p wasm-bindgen-test --precise 0.3.34 - cargo update -p serde_test --precise 1.0.175 -fi - -# Test if panic in C code aborts the process (either with a real panic or with SIGILL) -cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 \ - | tee /dev/stderr \ - | grep "SIGILL\\|\[libsecp256k1] illegal argument. !rustsecp256k1_v0_._._fe_is_zero(&ge->x)" - -# Make all cargo invocations verbose -export CARGO_TERM_VERBOSE=true - -# Defaults / sanity checks -cargo build --all -cargo test --all - -if [ "$DO_FEATURE_MATRIX" = true ]; then - cargo build --all --no-default-features - cargo test --all --no-default-features - - # All features - cargo build --all --no-default-features --features="$FEATURES" - cargo test --all --no-default-features --features="$FEATURES" - # Single features - for feature in ${FEATURES} - do - cargo build --all --no-default-features --features="$feature" - cargo test --all --no-default-features --features="$feature" - done - # Features tested with 'std' feature enabled. - for feature in ${FEATURES} - do - cargo build --all --no-default-features --features="std,$feature" - cargo test --all --no-default-features --features="std,$feature" - done - # Other combos - RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all - RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all --features="$FEATURES" - cargo test --all --features="rand serde" - - if [ "$NIGHTLY" = true ]; then - cargo test --all --all-features - RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all --all-features - fi - - # Examples - cargo run --example sign_verify --features=bitcoin-hashes-std - cargo run --example sign_verify_recovery --features=recovery,bitcoin-hashes-std - cargo run --example generate_keys --features=rand-std -fi - -if [ "$DO_LINT" = true ] -then - cargo clippy --all-features --all-targets -- -D warnings - cargo clippy --example sign_verify --features=bitcoin-hashes-std -- -D warnings - cargo clippy --example sign_verify_recovery --features=recovery,bitcoin-hashes-std -- -D warnings - cargo clippy --example generate_keys --features=rand-std -- -D warnings -fi - -# Build the docs if told to (this only works with the nightly toolchain) -if [ "$DO_DOCSRS" = true ]; then - RUSTDOCFLAGS="--cfg docsrs -D warnings -D rustdoc::broken-intra-doc-links" cargo +nightly doc --all-features -fi - -# Build the docs with a stable toolchain, in unison with the DO_DOCSRS command -# above this checks that we feature guarded docs imports correctly. -if [ "$DO_DOCS" = true ]; then - RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features -fi - -# Webassembly stuff -if [ "$DO_WASM" = true ]; then - clang --version - CARGO_TARGET_DIR=wasm cargo install --force wasm-pack - printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml - CC=clang wasm-pack build - CC=clang wasm-pack test --node -fi - -# Address Sanitizer -if [ "$DO_ASAN" = true ]; then - clang --version - cargo clean - CC='clang -fsanitize=address -fno-omit-frame-pointer' \ - RUSTFLAGS='-Zsanitizer=address -Clinker=clang -Cforce-frame-pointers=yes' \ - ASAN_OPTIONS='detect_leaks=1 detect_invalid_pointer_pairs=1 detect_stack_use_after_return=1' \ - cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu - cargo clean - # The -Cllvm-args=-msan-eager-checks=0 flag was added to overcome this issue: - # https://github.com/rust-bitcoin/rust-secp256k1/pull/573#issuecomment-1399465995 - CC='clang -fsanitize=memory -fno-omit-frame-pointer' \ - RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins -Cforce-frame-pointers=yes -Cllvm-args=-msan-eager-checks=0' \ - cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu - cargo run --release --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified Successfully" - cargo run --release --features=alloc --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified alloc Successfully" -fi - -# Run formatter if told to. -if [ "$DO_FMT" = true ]; then - if [ "$NIGHTLY" = false ]; then - echo "DO_FMT requires a nightly toolchain (consider using RUSTUP_TOOLCHAIN)" - exit 1 - fi - rustup component add rustfmt - cargo fmt --check || exit 1 -fi - -# Bench if told to, only works with non-stable toolchain (nightly, beta). -if [ "$DO_BENCH" = true ] -then - RUSTFLAGS='--cfg=bench' cargo bench --features=recovery,rand-std -fi - -exit 0 +$REPO_DIR/contrib/_test.sh From e358d993d7ab8fd965705bc910ab42ccd5ad39b5 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 21 Jul 2023 11:39:08 +1000 Subject: [PATCH 09/14] Run WASM tests from test wrapper script The `wasm-pack` command does not honour `cargo` flags passed to it so we cannot use `--locked` and test against pre-made lock files. Instead just run the WASM test from the test script wrapper. --- contrib/_test.sh | 9 --------- contrib/test.sh | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/contrib/_test.sh b/contrib/_test.sh index f2290674f..d0967e847 100755 --- a/contrib/_test.sh +++ b/contrib/_test.sh @@ -83,15 +83,6 @@ if [ "$DO_DOCS" = true ]; then RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features fi -# Webassembly stuff -if [ "$DO_WASM" = true ]; then - clang --version - CARGO_TARGET_DIR=wasm cargo install --force wasm-pack - printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml - CC=clang wasm-pack build - CC=clang wasm-pack test --node -fi - # Address Sanitizer if [ "$DO_ASAN" = true ]; then clang --version diff --git a/contrib/test.sh b/contrib/test.sh index 05b680c3c..b5031a8e3 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -4,4 +4,18 @@ set -ex REPO_DIR=$(git rev-parse --show-toplevel) +# Webassembly stuff +# +# The wasm-pack command does not correctly pass args to cargo so we cannot use --locked and test +# with per-commited lockfiles (recent/minimal). Just run the WASM tests from here instead. +if [ "$DO_WASM" = true ]; then + clang --version + CARGO_TARGET_DIR=wasm cargo install --force wasm-pack + printf '\n[lib]\ncrate-type = ["cdylib", "rlib"]\n' >> Cargo.toml + CC=clang wasm-pack build + CC=clang wasm-pack test --node + + exit 0 +fi + $REPO_DIR/contrib/_test.sh From 07bb476c5ec086e7510a2b4f94f387089b59280a Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 20 Jul 2023 11:00:34 +1000 Subject: [PATCH 10/14] Run test with recent/minimal lock files Update the CI scripts to use the minimal/recent lockfiles, requires using `--locked` for various `cargo` incantations. --- contrib/_test.sh | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/contrib/_test.sh b/contrib/_test.sh index d0967e847..9144ecab4 100755 --- a/contrib/_test.sh +++ b/contrib/_test.sh @@ -20,56 +20,56 @@ if cargo --version | grep "1\.48"; then fi # Test if panic in C code aborts the process (either with a real panic or with SIGILL) -cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 | tee /dev/stderr | grep "SIGILL\\|panicked at '\[libsecp256k1\]" +cargo test --locked -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 | tee /dev/stderr | grep "SIGILL\\|panicked at '\[libsecp256k1\]" # Make all cargo invocations verbose export CARGO_TERM_VERBOSE=true # Defaults / sanity checks -cargo build --all -cargo test --all +cargo build --locked --all +cargo test --locked --all if [ "$DO_FEATURE_MATRIX" = true ]; then - cargo build --all --no-default-features - cargo test --all --no-default-features + cargo build --locked --all --no-default-features + cargo test --locked --all --no-default-features # All features - cargo build --all --no-default-features --features="$FEATURES" - cargo test --all --no-default-features --features="$FEATURES" + cargo build --locked --all --no-default-features --features="$FEATURES" + cargo test --locked --all --no-default-features --features="$FEATURES" # Single features for feature in ${FEATURES} do - cargo build --all --no-default-features --features="$feature" - cargo test --all --no-default-features --features="$feature" + cargo build --locked --all --no-default-features --features="$feature" + cargo test --locked --all --no-default-features --features="$feature" done # Features tested with 'std' feature enabled. for feature in ${FEATURES} do - cargo build --all --no-default-features --features="std,$feature" - cargo test --all --no-default-features --features="std,$feature" + cargo build --locked --all --no-default-features --features="std,$feature" + cargo test --locked --all --no-default-features --features="std,$feature" done # Other combos - RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all - RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all --features="$FEATURES" - cargo test --all --features="rand serde" + RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --locked --all + RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --locked --all --features="$FEATURES" + cargo test --locked --all --features="rand serde" if [ "$NIGHTLY" = true ]; then - cargo test --all --all-features - RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --all --all-features + cargo test --locked --all --all-features + RUSTFLAGS='--cfg=secp256k1_fuzz' RUSTDOCFLAGS='--cfg=secp256k1_fuzz' cargo test --locked --all --all-features fi # Examples - cargo run --example sign_verify --features=bitcoin-hashes-std - cargo run --example sign_verify_recovery --features=recovery,bitcoin-hashes-std - cargo run --example generate_keys --features=rand-std + cargo run --locked --example sign_verify --features=bitcoin-hashes-std + cargo run --locked --example sign_verify_recovery --features=recovery,bitcoin-hashes-std + cargo run --locked --example generate_keys --features=rand-std fi if [ "$DO_LINT" = true ] then - cargo clippy --all-features --all-targets -- -D warnings - cargo clippy --example sign_verify --features=bitcoin-hashes-std -- -D warnings - cargo clippy --example sign_verify_recovery --features=recovery,bitcoin-hashes-std -- -D warnings - cargo clippy --example generate_keys --features=rand-std -- -D warnings + cargo clippy --locked --all-features --all-targets -- -D warnings + cargo clippy --locked --example sign_verify --features=bitcoin-hashes-std -- -D warnings + cargo clippy --locked --example sign_verify_recovery --features=recovery,bitcoin-hashes-std -- -D warnings + cargo clippy --locked --example generate_keys --features=rand-std -- -D warnings fi # Build the docs if told to (this only works with the nightly toolchain) From 41aca38b758debdb045d7d764ab48fb2367f8ba3 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 14 Jul 2023 12:44:19 +1000 Subject: [PATCH 11/14] Use hashes instead of bitcoin_hashes Use the more terse `hashes` by way of the `package` field in the manifest. Allows us to remove the ugly feature alias "bitcoin-hashes" -> "bitcoin_hashes" and removes all the bother with the underscore. Why did we not think of this 2 years ago? --- Cargo.toml | 11 +++++------ contrib/_test.sh | 10 +++++----- examples/sign_verify.rs | 4 ++-- examples/sign_verify_recovery.rs | 4 ++-- src/ecdh.rs | 8 ++++---- src/key.rs | 10 +++++----- src/lib.rs | 33 ++++++++++++++++---------------- src/secret.rs | 6 +++--- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0f265559c..ca1bc45a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,7 @@ default = ["std"] std = ["alloc", "secp256k1-sys/std"] # allow use of Secp256k1::new and related API that requires an allocator alloc = ["secp256k1-sys/alloc"] -bitcoin-hashes = ["bitcoin_hashes"] # Feature alias because of the underscore. -bitcoin-hashes-std = ["std", "bitcoin_hashes", "bitcoin_hashes/std"] +hashes-std = ["std", "hashes/std"] rand-std = ["std", "rand", "rand/std", "rand/std_rng"] recovery = ["secp256k1-sys/recovery"] lowmemory = ["secp256k1-sys/lowmemory"] @@ -40,8 +39,8 @@ secp256k1-sys = { version = "0.8.1", default-features = false, path = "./secp256 serde = { version = "1.0.103", default-features = false, optional = true } # You likely only want to enable these if you explicitly do not want to use "std", otherwise enable -# the respective -std feature e.g., bitcoin-hashes-std -bitcoin_hashes = { version = "0.12", default-features = false, optional = true } +# the respective -std feature e.g., hashes-std +hashes = { package = "bitcoin_hashes", version = "0.12.0", default-features = false, optional = true } rand = { version = "0.8", default-features = false, optional = true } [dev-dependencies] @@ -57,11 +56,11 @@ getrandom = { version = "0.2", features = ["js"] } [[example]] name = "sign_verify_recovery" -required-features = ["recovery", "bitcoin-hashes-std"] +required-features = ["recovery", "hashes-std"] [[example]] name = "sign_verify" -required-features = ["bitcoin-hashes-std"] +required-features = ["hashes-std"] [[example]] name = "generate_keys" diff --git a/contrib/_test.sh b/contrib/_test.sh index 9144ecab4..1b1bbdccd 100755 --- a/contrib/_test.sh +++ b/contrib/_test.sh @@ -2,7 +2,7 @@ set -ex -FEATURES="bitcoin-hashes global-context lowmemory rand recovery serde std alloc bitcoin-hashes-std rand-std" +FEATURES="hashes global-context lowmemory rand recovery serde std alloc hashes-std rand-std" cargo --version rustc --version @@ -59,16 +59,16 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then fi # Examples - cargo run --locked --example sign_verify --features=bitcoin-hashes-std - cargo run --locked --example sign_verify_recovery --features=recovery,bitcoin-hashes-std + cargo run --locked --example sign_verify --features=hashes-std + cargo run --locked --example sign_verify_recovery --features=recovery,hashes-std cargo run --locked --example generate_keys --features=rand-std fi if [ "$DO_LINT" = true ] then cargo clippy --locked --all-features --all-targets -- -D warnings - cargo clippy --locked --example sign_verify --features=bitcoin-hashes-std -- -D warnings - cargo clippy --locked --example sign_verify_recovery --features=recovery,bitcoin-hashes-std -- -D warnings + cargo clippy --locked --example sign_verify --features=hashes-std -- -D warnings + cargo clippy --locked --example sign_verify_recovery --features=recovery,hashes-std -- -D warnings cargo clippy --locked --example generate_keys --features=rand-std -- -D warnings fi diff --git a/examples/sign_verify.rs b/examples/sign_verify.rs index 081d1b062..6087c1a16 100644 --- a/examples/sign_verify.rs +++ b/examples/sign_verify.rs @@ -1,7 +1,7 @@ -extern crate bitcoin_hashes; +extern crate hashes; extern crate secp256k1; -use bitcoin_hashes::{sha256, Hash}; +use hashes::{sha256, Hash}; use secp256k1::{ecdsa, Error, Message, PublicKey, Secp256k1, SecretKey, Signing, Verification}; fn verify( diff --git a/examples/sign_verify_recovery.rs b/examples/sign_verify_recovery.rs index edcc7b3bc..09baaabd0 100644 --- a/examples/sign_verify_recovery.rs +++ b/examples/sign_verify_recovery.rs @@ -1,7 +1,7 @@ -extern crate bitcoin_hashes; +extern crate hashes; extern crate secp256k1; -use bitcoin_hashes::{sha256, Hash}; +use hashes::{sha256, Hash}; use secp256k1::{ecdsa, Error, Message, PublicKey, Secp256k1, SecretKey, Signing, Verification}; fn recover( diff --git a/src/ecdh.rs b/src/ecdh.rs index e01366e53..e53dd79dd 100644 --- a/src/ecdh.rs +++ b/src/ecdh.rs @@ -110,7 +110,7 @@ impl AsRef<[u8]> for SharedSecret { /// /// # Examples /// ``` -/// # #[cfg(all(feature = "bitcoin-hashes-std", feature = "rand-std"))] { +/// # #[cfg(all(feature = "hashes-std", feature = "rand-std"))] { /// # use secp256k1::{ecdh, rand, Secp256k1, PublicKey, SecretKey}; /// # use secp256k1::hashes::{Hash, sha512}; /// @@ -225,9 +225,9 @@ mod tests { #[test] #[cfg(not(secp256k1_fuzz))] - #[cfg(all(feature = "bitcoin-hashes-std", feature = "rand-std"))] - fn bitcoin_hashes_and_sys_generate_same_secret() { - use bitcoin_hashes::{sha256, Hash, HashEngine}; + #[cfg(all(feature = "hashes-std", feature = "rand-std"))] + fn hashes_and_sys_generate_same_secret() { + use hashes::{sha256, Hash, HashEngine}; use crate::ecdh::shared_secret_point; diff --git a/src/key.rs b/src/key.rs index ecec1796f..651eb5e72 100644 --- a/src/key.rs +++ b/src/key.rs @@ -16,7 +16,7 @@ use crate::Error::{self, InvalidPublicKey, InvalidPublicKeySum, InvalidSecretKey use crate::{constants, from_hex, schnorr, Message, Scalar, Secp256k1, Signing, Verification}; #[cfg(feature = "global-context")] use crate::{ecdsa, SECP256K1}; -#[cfg(feature = "bitcoin_hashes")] +#[cfg(feature = "hashes")] use crate::{hashes, ThirtyTwoByteHash}; /// Secret 256-bit key used as `x` in an ECDSA signature. @@ -253,12 +253,12 @@ impl SecretKey { /// Constructs a [`SecretKey`] by hashing `data` with hash algorithm `H`. /// - /// Requires the feature `bitcoin_hashes` to be enabled. + /// Requires the feature `hashes` to be enabled. /// /// # Examples /// /// ``` - /// # #[cfg(feature="bitcoin_hashes")] { + /// # #[cfg(feature="hashes")] { /// use secp256k1::hashes::{sha256, Hash}; /// use secp256k1::SecretKey; /// @@ -269,7 +269,7 @@ impl SecretKey { /// assert_eq!(sk1, sk2); /// # } /// ``` - #[cfg(feature = "bitcoin_hashes")] + #[cfg(feature = "hashes")] #[inline] pub fn from_hashed_data(data: &[u8]) -> Self { ::hash(data).into() @@ -366,7 +366,7 @@ impl SecretKey { } } -#[cfg(feature = "bitcoin_hashes")] +#[cfg(feature = "hashes")] impl From for SecretKey { /// Converts a 32-byte hash directly to a secret key without error paths. fn from(t: T) -> SecretKey { diff --git a/src/lib.rs b/src/lib.rs index 14d65f224..11f5132bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,7 +28,7 @@ //! trigger any assertion failures in the upstream library. //! //! ```rust -//! # #[cfg(all(feature = "rand-std", feature = "bitcoin-hashes-std"))] { +//! # #[cfg(all(feature = "rand-std", feature = "hashes-std"))] { //! use secp256k1::rand::rngs::OsRng; //! use secp256k1::{Secp256k1, Message}; //! use secp256k1::hashes::sha256; @@ -45,7 +45,7 @@ //! If the "global-context" feature is enabled you have access to an alternate API. //! //! ```rust -//! # #[cfg(all(feature = "global-context", feature = "bitcoin-hashes-std", feature = "rand-std"))] { +//! # #[cfg(all(feature = "global-context", feature = "hashes-std", feature = "rand-std"))] { //! use secp256k1::{generate_keypair, Message}; //! use secp256k1::hashes::sha256; //! @@ -57,7 +57,7 @@ //! # } //! ``` //! -//! The above code requires `rust-secp256k1` to be compiled with the `rand-std` and `bitcoin-hashes-std` +//! The above code requires `rust-secp256k1` to be compiled with the `rand-std` and `hashes-std` //! feature enabled, to get access to [`generate_keypair`](struct.Secp256k1.html#method.generate_keypair) //! Alternately, keys and messages can be parsed from slices, like //! @@ -69,7 +69,7 @@ //! let secret_key = SecretKey::from_slice(&[0xcd; 32]).expect("32 bytes, within curve order"); //! let public_key = PublicKey::from_secret_key(&secp, &secret_key); //! // This is unsafe unless the supplied byte slice is the output of a cryptographic hash function. -//! // See the above example for how to use this library together with `bitcoin-hashes-std`. +//! // See the above example for how to use this library together with `hashes-std`. //! let message = Message::from_slice(&[0xab; 32]).expect("32 bytes"); //! //! let sig = secp.sign_ecdsa(&message, &secret_key); @@ -127,8 +127,8 @@ //! * `alloc` - use the `alloc` standard Rust library to provide heap allocations. //! * `rand` - use `rand` library to provide random generator (e.g. to generate keys). //! * `rand-std` - use `rand` library with its `std` feature enabled. (Implies `rand`.) -//! * `bitcoin-hashes` - use the `bitcoin_hashes` library. -//! * `bitcoin-hashes-std` - use the `bitcoin_hashes` library with its `std` feature enabled (implies `bitcoin-hashes`). +//! * `hashes` - use the `hashes` library. +//! * `hashes-std` - use the `hashes` library with its `std` feature enabled (implies `hashes`). //! * `recovery` - enable functions that can compute the public key from signature. //! * `lowmemory` - optimize the library for low-memory environments. //! * `global-context` - enable use of global secp256k1 context (implies `std`). @@ -151,6 +151,9 @@ extern crate core; #[cfg(bench)] extern crate test; +#[cfg(feature = "hashes")] +pub extern crate hashes; + #[macro_use] mod macros; #[macro_use] @@ -170,8 +173,6 @@ use core::marker::PhantomData; use core::ptr::NonNull; use core::{fmt, mem, str}; -#[cfg(feature = "bitcoin_hashes")] -pub use bitcoin_hashes as hashes; #[cfg(feature = "global-context")] pub use context::global::SECP256K1; #[cfg(feature = "rand")] @@ -183,7 +184,7 @@ pub use serde; pub use crate::context::*; use crate::ffi::types::AlignedType; use crate::ffi::CPtr; -#[cfg(feature = "bitcoin_hashes")] +#[cfg(feature = "hashes")] use crate::hashes::Hash; pub use crate::key::{PublicKey, SecretKey, *}; pub use crate::scalar::Scalar; @@ -196,17 +197,17 @@ pub trait ThirtyTwoByteHash { fn into_32(self) -> [u8; 32]; } -#[cfg(feature = "bitcoin_hashes")] +#[cfg(feature = "hashes")] impl ThirtyTwoByteHash for hashes::sha256::Hash { fn into_32(self) -> [u8; 32] { self.to_byte_array() } } -#[cfg(feature = "bitcoin_hashes")] +#[cfg(feature = "hashes")] impl ThirtyTwoByteHash for hashes::sha256d::Hash { fn into_32(self) -> [u8; 32] { self.to_byte_array() } } -#[cfg(feature = "bitcoin_hashes")] +#[cfg(feature = "hashes")] impl ThirtyTwoByteHash for hashes::sha256t::Hash { fn into_32(self) -> [u8; 32] { self.to_byte_array() } } @@ -238,12 +239,12 @@ impl Message { /// Constructs a [`Message`] by hashing `data` with hash algorithm `H`. /// - /// Requires the feature `bitcoin-hashes` to be enabled. + /// Requires the feature `hashes` to be enabled. /// /// # Examples /// /// ``` - /// # #[cfg(feature = "bitcoin_hashes")] { + /// # #[cfg(feature = "hashes")] { /// use secp256k1::hashes::{sha256, Hash}; /// use secp256k1::Message; /// @@ -254,7 +255,7 @@ impl Message { /// assert_eq!(m1, m2); /// # } /// ``` - #[cfg(feature = "bitcoin_hashes")] + #[cfg(feature = "hashes")] pub fn from_hashed_data(data: &[u8]) -> Self { ::hash(data).into() } @@ -1012,7 +1013,7 @@ mod tests { assert!(SECP256K1.verify_ecdsa(&msg, &sig, &pk).is_ok()); } - #[cfg(feature = "bitcoin_hashes")] + #[cfg(feature = "hashes")] #[test] fn test_from_hash() { use crate::hashes::{self, Hash}; diff --git a/src/secret.rs b/src/secret.rs index cec8a2f33..689501c21 100644 --- a/src/secret.rs +++ b/src/secret.rs @@ -32,7 +32,7 @@ macro_rules! impl_display_secret { } } - #[cfg(all(not(feature = "std"), feature = "bitcoin_hashes"))] + #[cfg(all(not(feature = "std"), feature = "hashes"))] impl ::core::fmt::Debug for $thing { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { use crate::hashes::{sha256, Hash, HashEngine}; @@ -50,10 +50,10 @@ macro_rules! impl_display_secret { } } - #[cfg(all(not(feature = "std"), not(feature = "bitcoin_hashes")))] + #[cfg(all(not(feature = "std"), not(feature = "hashes")))] impl ::core::fmt::Debug for $thing { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - write!(f, "") + write!(f, "") } } }; From dd78b87daf9cda23f76a0176ab7725ff90d276ab Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 14 Jul 2023 14:19:20 +1000 Subject: [PATCH 12/14] Clean up hashes import statements Now that we have `hashes` as the crate name of `bitcoin_hashes` we can slightly clean up the import statements. This is based on the convention we have to import things directly from the crate if we depend on it and not from the crate level re-export. --- src/lib.rs | 10 +++++----- src/secret.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 11f5132bc..69f72b6dd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -175,6 +175,8 @@ use core::{fmt, mem, str}; #[cfg(feature = "global-context")] pub use context::global::SECP256K1; +#[cfg(feature = "hashes")] +use hashes::Hash; #[cfg(feature = "rand")] pub use rand; pub use secp256k1_sys as ffi; @@ -184,8 +186,6 @@ pub use serde; pub use crate::context::*; use crate::ffi::types::AlignedType; use crate::ffi::CPtr; -#[cfg(feature = "hashes")] -use crate::hashes::Hash; pub use crate::key::{PublicKey, SecretKey, *}; pub use crate::scalar::Scalar; @@ -1016,16 +1016,16 @@ mod tests { #[cfg(feature = "hashes")] #[test] fn test_from_hash() { - use crate::hashes::{self, Hash}; + use hashes::{sha256, sha256d, Hash}; let test_bytes = "Hello world!".as_bytes(); - let hash = hashes::sha256::Hash::hash(test_bytes); + let hash = sha256::Hash::hash(test_bytes); let msg = Message::from(hash); assert_eq!(msg.0, hash.to_byte_array()); assert_eq!(msg, Message::from_hashed_data::(test_bytes)); - let hash = hashes::sha256d::Hash::hash(test_bytes); + let hash = sha256d::Hash::hash(test_bytes); let msg = Message::from(hash); assert_eq!(msg.0, hash.to_byte_array()); assert_eq!(msg, Message::from_hashed_data::(test_bytes)); diff --git a/src/secret.rs b/src/secret.rs index 689501c21..fa460d6ad 100644 --- a/src/secret.rs +++ b/src/secret.rs @@ -35,7 +35,7 @@ macro_rules! impl_display_secret { #[cfg(all(not(feature = "std"), feature = "hashes"))] impl ::core::fmt::Debug for $thing { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { - use crate::hashes::{sha256, Hash, HashEngine}; + use hashes::{sha256, Hash, HashEngine}; let tag = "rust-secp256k1DEBUG"; From 7f782302ef0c5a04b75e4aa1f7d83bda569c1318 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 14 Jul 2023 14:49:48 +1000 Subject: [PATCH 13/14] WIP: Depend on unreleased hashes v0.13.0 --- Cargo.toml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ca1bc45a7..95e4e92ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ serde = { version = "1.0.103", default-features = false, optional = true } # You likely only want to enable these if you explicitly do not want to use "std", otherwise enable # the respective -std feature e.g., hashes-std -hashes = { package = "bitcoin_hashes", version = "0.12.0", default-features = false, optional = true } +hashes = { package = "bitcoin_hashes", version = "0.13.0", default-features = false, optional = true } rand = { version = "0.8", default-features = false, optional = true } [dev-dependencies] @@ -69,3 +69,12 @@ required-features = ["rand-std"] [workspace] members = ["secp256k1-sys"] exclude = ["no_std_test"] + +# TODO: Remove this when hashes v.0.13.0 is released. +[patch.crates-io.bitcoin_hashes] +git = "https://github.com/tcharding/rust-bitcoin" +# source branch: tharding/06-20-hashes-release +# rust-bicoin PR: #1917 +# One commit back from branch tip. +# commit: `hashes: Bump version to 0.13.0` +rev = "37d1d288a67fe7e0cd53962f66faa854621bade0" From 1b299ba502973879b87e693dbcf625dc0e5d6f53 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 9 Aug 2023 10:49:08 +1000 Subject: [PATCH 14/14] WIP: Release version 0.28.0 WIP because the lock file changes will need redoing once hashes is released. Prepare for release of 0.28.0 by doing: - Bump the version number in the manifest - Add changelog entry - Update the commited minimal/recent lock files --- CHANGELOG.md | 7 +++++-- Cargo-minimal.lock | 22 ++++++++++++++-------- Cargo-recent.lock | 22 ++++++++++++++-------- Cargo.toml | 2 +- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d60912ce1..bdc62e859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ -# Unreleased +# 0.28.0 - 202-08-09 -* Bump MSRV to 1.48 +* Depend on recent release of `bitcoin_hashes` v0.13.0 [#621](https://github.com/rust-bitcoin/rust-secp256k1/pull/621) +* Add a verify function to `PublicKey` [#618](https://github.com/rust-bitcoin/rust-secp256k1/pull/618) +* Add serialize function for schnorr::Signature [#607](https://github.com/rust-bitcoin/rust-secp256k1/pull/607) +* Bump MSRV to 1.48 [#595](https://github.com/rust-bitcoin/rust-secp256k1/pull/595) * Remove implementations of `PartialEq`, `Eq`, `PartialOrd`, `Ord`, and `Hash` from the `impl_array_newtype` macro. Users will now need to derive these traits if they are wanted. diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index 134cc67ec..0c2ca1718 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -18,18 +18,18 @@ dependencies = [ ] [[package]] -name = "bitcoin-private" -version = "0.1.0" +name = "bitcoin-internals" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" [[package]] name = "bitcoin_hashes" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" +version = "0.13.0" +source = "git+https://github.com/tcharding/rust-bitcoin?rev=37d1d288a67fe7e0cd53962f66faa854621bade0#37d1d288a67fe7e0cd53962f66faa854621bade0" dependencies = [ - "bitcoin-private", + "bitcoin-internals", + "hex-conservative", ] [[package]] @@ -103,6 +103,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee6c0438de3ca4d8cac2eec62b228e2f8865cfe9ebefea720406774223fa2d2e" +[[package]] +name = "hex-conservative" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" + [[package]] name = "itoa" version = "0.3.0" @@ -250,7 +256,7 @@ checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" [[package]] name = "secp256k1" -version = "0.27.0" +version = "0.28.0" dependencies = [ "bincode", "bitcoin_hashes", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 72882b8eb..a176e436e 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -12,18 +12,18 @@ dependencies = [ ] [[package]] -name = "bitcoin-private" -version = "0.1.0" +name = "bitcoin-internals" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" [[package]] name = "bitcoin_hashes" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" +version = "0.13.0" +source = "git+https://github.com/tcharding/rust-bitcoin?rev=37d1d288a67fe7e0cd53962f66faa854621bade0#37d1d288a67fe7e0cd53962f66faa854621bade0" dependencies = [ - "bitcoin-private", + "bitcoin-internals", + "hex-conservative", ] [[package]] @@ -79,6 +79,12 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +[[package]] +name = "hex-conservative" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" + [[package]] name = "js-sys" version = "0.3.61" @@ -171,7 +177,7 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "secp256k1" -version = "0.27.0" +version = "0.28.0" dependencies = [ "bincode", "bitcoin_hashes", diff --git a/Cargo.toml b/Cargo.toml index 95e4e92ea..d5704d357 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "secp256k1" -version = "0.27.0" +version = "0.28.0" authors = [ "Dawid Ciężarkiewicz ", "Andrew Poelstra " ] license = "CC0-1.0"