Skip to content

Commit f247511

Browse files
Upgrade to secp256k1 0.21
Release 0.21 includes a module restructure which we can now make use of. This simplifies some imports.
1 parent fae5f1c commit f247511

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Cargo.toml

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

3232
[dependencies]
33-
secp256k1 = "0.20.0"
33+
secp256k1 = "0.21.0"
3434
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 }

src/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ pub use secp256k1_zkp_sys as ffi;
4343

4444
extern crate secp256k1;
4545

46-
#[cfg(feature = "bitcoin_hashes")]
47-
pub use secp256k1::bitcoin_hashes as hashes;
4846
#[cfg(any(test, feature = "std"))]
4947
extern crate core;
5048
#[cfg(any(test, feature = "rand"))]
@@ -65,8 +63,6 @@ use core::{fmt, str};
6563

6664
pub use secp256k1::*;
6765

68-
pub use key::{PublicKey, SecretKey};
69-
7066
#[cfg(feature = "serde")]
7167
mod serde_util;
7268
mod zkp;

src/zkp/ecdsa_adaptor.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ use ffi::{self, CPtr, ECDSA_ADAPTOR_SIGNATURE_LENGTH};
1313
use rand::thread_rng;
1414
#[cfg(any(test, feature = "rand"))]
1515
use rand::{CryptoRng, Rng};
16-
use {constants, PublicKey, Secp256k1, SecretKey};
16+
use secp256k1::ecdsa::Signature;
17+
use secp256k1::{PublicKey, SecretKey};
18+
use Verification;
19+
use {constants, Secp256k1};
1720
use {from_hex, Error};
1821
use {Message, Signing};
19-
use {Signature, Verification};
2022

2123
/// Represents an adaptor signature and dleq proof.
2224
#[derive(Debug, PartialEq, Clone, Copy, Eq)]

src/zkp/rangeproof.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
use ffi::RANGEPROOF_MAX_LENGTH;
22
use from_hex;
3+
use secp256k1::SecretKey;
34
use std::ops::Range;
45
use std::str;
56
use Error;
67
use Generator;
78
use PedersenCommitment;
89
use Verification;
9-
use {ffi, Secp256k1, SecretKey, Signing, Tweak};
10+
use {ffi, Secp256k1, Signing, Tweak};
1011

1112
/// Represents a range proof.
1213
///
@@ -203,7 +204,7 @@ impl RangeProof {
203204
#[cfg(feature = "bitcoin_hashes")]
204205
impl ::core::fmt::Display for RangeProof {
205206
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
206-
use bitcoin_hashes::hex::format_hex;
207+
use hashes::hex::format_hex;
207208

208209
format_hex(self.serialize().as_slice(), f)
209210
}

src/zkp/whitelist.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ use core::ptr;
1010
use ffi::CPtr;
1111
#[cfg(feature = "std")]
1212
use from_hex;
13-
use {ffi, secp256k1, Error, PublicKey, Secp256k1, SecretKey, Signing, Verification};
13+
use secp256k1::{PublicKey, SecretKey};
14+
use {ffi, secp256k1, Error, Secp256k1, Signing, Verification};
1415

1516
/// A whitelist ring signature.
1617
#[derive(Clone, PartialEq, Eq, Hash)]

0 commit comments

Comments
 (0)