diff --git a/Cargo.toml b/Cargo.toml index 47b2b6f7..75af424e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ use-serde = ["serde", "secp256k1/serde"] use-rand = ["rand", "secp256k1/rand"] [dependencies] -secp256k1 = "0.20.0" +secp256k1 = "0.21.0" secp256k1-zkp-sys = { version = "0.5.0", default-features = false, path = "./secp256k1-zkp-sys" } rand = { version = "0.6", default-features = false, optional = true } serde = { version = "1.0", default-features = false, optional = true } diff --git a/src/lib.rs b/src/lib.rs index 722de326..b018fdf4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,8 +43,6 @@ pub use secp256k1_zkp_sys as ffi; extern crate secp256k1; -#[cfg(feature = "bitcoin_hashes")] -pub use secp256k1::bitcoin_hashes as hashes; #[cfg(any(test, feature = "std"))] extern crate core; #[cfg(any(test, feature = "rand"))] @@ -65,8 +63,6 @@ use core::{fmt, str}; pub use secp256k1::*; -pub use key::{PublicKey, SecretKey}; - #[cfg(feature = "serde")] mod serde_util; mod zkp; diff --git a/src/zkp/ecdsa_adaptor.rs b/src/zkp/ecdsa_adaptor.rs index 37fb497e..8cf08005 100644 --- a/src/zkp/ecdsa_adaptor.rs +++ b/src/zkp/ecdsa_adaptor.rs @@ -13,10 +13,12 @@ use ffi::{self, CPtr, ECDSA_ADAPTOR_SIGNATURE_LENGTH}; use rand::thread_rng; #[cfg(any(test, feature = "rand"))] use rand::{CryptoRng, Rng}; -use {constants, PublicKey, Secp256k1, SecretKey}; +use secp256k1::ecdsa::Signature; +use secp256k1::{PublicKey, SecretKey}; +use Verification; +use {constants, Secp256k1}; use {from_hex, Error}; use {Message, Signing}; -use {Signature, Verification}; /// Represents an adaptor signature and dleq proof. #[derive(Debug, PartialEq, Clone, Copy, Eq)] @@ -309,7 +311,7 @@ mod tests { .decrypt(&adaptor_secret) .expect("to be able to decrypt using the correct secret"); SECP256K1 - .verify(&msg, &sig, &pubkey) + .verify_ecdsa(&msg, &sig, &pubkey) .expect("signature to be valid"); let recovered = adaptor_sig .recover(&SECP256K1, &sig, &adaptor) diff --git a/src/zkp/rangeproof.rs b/src/zkp/rangeproof.rs index d950c7dc..2f7fe132 100644 --- a/src/zkp/rangeproof.rs +++ b/src/zkp/rangeproof.rs @@ -1,12 +1,13 @@ use ffi::RANGEPROOF_MAX_LENGTH; use from_hex; +use secp256k1::SecretKey; use std::ops::Range; use std::str; use Error; use Generator; use PedersenCommitment; use Verification; -use {ffi, Secp256k1, SecretKey, Signing, Tweak}; +use {ffi, Secp256k1, Signing, Tweak}; /// Represents a range proof. /// @@ -203,7 +204,7 @@ impl RangeProof { #[cfg(feature = "bitcoin_hashes")] impl ::core::fmt::Display for RangeProof { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - use bitcoin_hashes::hex::format_hex; + use hashes::hex::format_hex; format_hex(self.serialize().as_slice(), f) } diff --git a/src/zkp/surjection_proof.rs b/src/zkp/surjection_proof.rs index f1e1c8cf..6756a9e0 100644 --- a/src/zkp/surjection_proof.rs +++ b/src/zkp/surjection_proof.rs @@ -183,7 +183,7 @@ impl SurjectionProof { #[cfg(feature = "bitcoin_hashes")] impl ::core::fmt::Display for SurjectionProof { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - use bitcoin_hashes::hex::format_hex; + use hashes::hex::format_hex; format_hex(self.serialize().as_slice(), f) } diff --git a/src/zkp/whitelist.rs b/src/zkp/whitelist.rs index ad94b4c7..b37001dd 100644 --- a/src/zkp/whitelist.rs +++ b/src/zkp/whitelist.rs @@ -10,7 +10,8 @@ use core::ptr; use ffi::CPtr; #[cfg(feature = "std")] use from_hex; -use {ffi, secp256k1, Error, PublicKey, Secp256k1, SecretKey, Signing, Verification}; +use secp256k1::{PublicKey, SecretKey}; +use {ffi, secp256k1, Error, Secp256k1, Signing, Verification}; /// A whitelist ring signature. #[derive(Clone, PartialEq, Eq, Hash)]