Skip to content

Commit bcd5419

Browse files
committed
fix warning
1 parent 7a5d78c commit bcd5419

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

secp256k1-zkp-sys/src/zkp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use core::{fmt, hash};
2-
use {types::*, Context, Keypair, PublicKey, Signature, XOnlyPublicKey};
32
use zkp::hash::Hash;
3+
use {types::*, Context, Keypair, PublicKey, Signature, XOnlyPublicKey};
44

55
/// Rangeproof maximum length
66
pub const RANGEPROOF_MAX_LENGTH: size_t = 5134;

src/zkp/musig.rs

+24-24
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use {core, std};
1313

1414
use crate::ffi::{self, CPtr};
1515
use crate::ZERO_TWEAK;
16-
use crate::{schnorr, KeyPair, XOnlyPublicKey};
16+
use crate::{schnorr, Keypair, XOnlyPublicKey};
1717
use crate::{Message, PublicKey, Secp256k1, SecretKey, Tweak};
1818
use crate::{Signing, Verification};
1919
use secp256k1::Parity;
@@ -114,7 +114,7 @@ impl MusigKeyAggCache {
114114
/// ```rust
115115
/// # # [cfg(any(test, feature = "rand-std"))] {
116116
/// # use secp256k1_zkp::rand::{thread_rng, RngCore};
117-
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, KeyPair, PublicKey};
117+
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, Keypair, PublicKey};
118118
/// # let secp = Secp256k1::new();
119119
/// # let sk1 = SecretKey::new(&mut thread_rng());
120120
/// # let pub_key1 = PublicKey::from_secret_key(&secp, &sk1);
@@ -177,7 +177,7 @@ impl MusigKeyAggCache {
177177
/// ```rust
178178
/// # # [cfg(any(test, feature = "rand-std"))] {
179179
/// # use secp256k1_zkp::rand::{thread_rng, RngCore};
180-
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, KeyPair, PublicKey};
180+
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, Keypair, PublicKey};
181181
/// # let secp = Secp256k1::new();
182182
/// # let sk1 = SecretKey::new(&mut thread_rng());
183183
/// # let pub_key1 = PublicKey::from_secret_key(&secp, &sk1);
@@ -234,7 +234,7 @@ impl MusigKeyAggCache {
234234
/// ```rust
235235
/// # # [cfg(any(test, feature = "rand-std"))] {
236236
/// # use secp256k1_zkp::rand::{thread_rng, RngCore};
237-
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, KeyPair, PublicKey};
237+
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, Keypair, PublicKey};
238238
/// # let secp = Secp256k1::new();
239239
/// # let sk1 = SecretKey::new(&mut thread_rng());
240240
/// # let pub_key1 = PublicKey::from_secret_key(&secp, &sk1);
@@ -308,7 +308,7 @@ impl MusigKeyAggCache {
308308
/// ```rust
309309
/// # # [cfg(any(test, feature = "rand-std"))] {
310310
/// # use secp256k1_zkp::rand::{thread_rng, RngCore};
311-
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, KeyPair, PublicKey, MusigSessionId, Message};
311+
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, Keypair, PublicKey, MusigSessionId, Message};
312312
/// # let secp = Secp256k1::new();
313313
/// # let sk1 = SecretKey::new(&mut thread_rng());
314314
/// # let pub_key1 = PublicKey::from_secret_key(&secp, &sk1);
@@ -319,7 +319,7 @@ impl MusigKeyAggCache {
319319
/// // The session id must be sampled at random. Read documentation for more details.
320320
/// let session_id = MusigSessionId::new(&mut thread_rng());
321321
///
322-
/// let msg = Message::from_slice(b"Public Message we want to sign!!").unwrap();
322+
/// let msg = Message::from_digest_slice(b"Public Message we want to sign!!").unwrap();
323323
///
324324
/// // Provide the current time for mis-use resistance
325325
/// let extra_rand : Option<[u8; 32]> = None;
@@ -678,7 +678,7 @@ pub fn adapt(
678678
/// ```rust
679679
/// # # [cfg(any(test, feature = "rand-std"))] {
680680
/// # use secp256k1_zkp::rand::{thread_rng, RngCore};
681-
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, KeyPair, PublicKey, MusigSessionId, Message, MusigAggNonce, MusigSession, adapt, extract_adaptor, Tweak};
681+
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, Keypair, PublicKey, MusigSessionId, Message, MusigAggNonce, MusigSession, adapt, extract_adaptor, Tweak};
682682
/// # let secp = Secp256k1::new();
683683
/// # let sk1 = SecretKey::new(&mut thread_rng());
684684
/// # let pub_key1 = PublicKey::from_secret_key(&secp, &sk1);
@@ -688,7 +688,7 @@ pub fn adapt(
688688
/// let key_agg_cache = MusigKeyAggCache::new(&secp, &[pub_key1, pub_key2]);
689689
/// // The session id must be sampled at random. Read documentation for more details.
690690
///
691-
/// let msg = Message::from_slice(b"Public Message we want to sign!!").unwrap();
691+
/// let msg = Message::from_digest_slice(b"Public Message we want to sign!!").unwrap();
692692
///
693693
/// // Provide the current time for mis-use resistance
694694
/// let session_id1 = MusigSessionId::new(&mut thread_rng());
@@ -718,15 +718,15 @@ pub fn adapt(
718718
/// let partial_sig1 = session.partial_sign(
719719
/// &secp,
720720
/// sec_nonce1,
721-
/// &KeyPair::from_secret_key(&secp, &sk1),
721+
/// &Keypair::from_secret_key(&secp, &sk1),
722722
/// &key_agg_cache,
723723
/// ).unwrap();
724724
///
725725
/// // Other party creates the other partial signature
726726
/// let partial_sig2 = session.partial_sign(
727727
/// &secp,
728728
/// sec_nonce2,
729-
/// &KeyPair::from_secret_key(&secp, &sk2),
729+
/// &Keypair::from_secret_key(&secp, &sk2),
730730
/// &key_agg_cache,
731731
/// ).unwrap();
732732
///
@@ -916,7 +916,7 @@ impl MusigAggNonce {
916916
/// ```rust
917917
/// # # [cfg(any(test, feature = "rand-std"))] {
918918
/// # use secp256k1_zkp::rand::{thread_rng, RngCore};
919-
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, KeyPair, PublicKey, MusigSessionId, Message, MusigAggNonce};
919+
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, Keypair, PublicKey, MusigSessionId, Message, MusigAggNonce};
920920
/// # let secp = Secp256k1::new();
921921
/// # let sk1 = SecretKey::new(&mut thread_rng());
922922
/// # let pub_key1 = PublicKey::from_secret_key(&secp, &sk1);
@@ -926,7 +926,7 @@ impl MusigAggNonce {
926926
/// # let key_agg_cache = MusigKeyAggCache::new(&secp, &[pub_key1, pub_key2]);
927927
/// // The session id must be sampled at random. Read documentation for more details.
928928
///
929-
/// let msg = Message::from_slice(b"Public Message we want to sign!!").unwrap();
929+
/// let msg = Message::from_digest_slice(b"Public Message we want to sign!!").unwrap();
930930
///
931931
/// let session_id1 = MusigSessionId::new(&mut thread_rng());
932932
/// let (_sec_nonce1, pub_nonce1) = key_agg_cache.nonce_gen(&secp, session_id1, pub_key1, msg, None)
@@ -1059,7 +1059,7 @@ impl MusigSession {
10591059
/// ```rust
10601060
/// # # [cfg(any(test, feature = "rand-std"))] {
10611061
/// # use secp256k1_zkp::rand::{thread_rng, RngCore};
1062-
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, KeyPair, PublicKey, MusigSessionId, Message, MusigAggNonce, MusigSession};
1062+
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, Keypair, PublicKey, MusigSessionId, Message, MusigAggNonce, MusigSession};
10631063
/// # let secp = Secp256k1::new();
10641064
/// # let sk1 = SecretKey::new(&mut thread_rng());
10651065
/// # let pub_key1 = PublicKey::from_secret_key(&secp, &sk1);
@@ -1069,7 +1069,7 @@ impl MusigSession {
10691069
/// # let key_agg_cache = MusigKeyAggCache::new(&secp, &[pub_key1, pub_key2]);
10701070
/// // The session id must be sampled at random. Read documentation for more details.
10711071
///
1072-
/// let msg = Message::from_slice(b"Public Message we want to sign!!").unwrap();
1072+
/// let msg = Message::from_digest_slice(b"Public Message we want to sign!!").unwrap();
10731073
///
10741074
/// // Provide the current time for mis-use resistance
10751075
/// let session_id1 = MusigSessionId::new(&mut thread_rng());
@@ -1164,7 +1164,7 @@ impl MusigSession {
11641164
/// * `sec_nonce`: [`MusigSecNonce`] to be used for this session that has never
11651165
/// been used before. For mis-use resistance, this API takes a mutable reference
11661166
/// to `sec_nonce` and sets it to zero even if the partial signing fails.
1167-
/// * `key_pair`: The [`KeyPair`] to sign the message
1167+
/// * `key_pair`: The [`Keypair`] to sign the message
11681168
/// * `key_agg_cache`: [`MusigKeyAggCache`] containing the aggregate pubkey used in
11691169
/// the creation of this session
11701170
///
@@ -1176,7 +1176,7 @@ impl MusigSession {
11761176
&self,
11771177
secp: &Secp256k1<C>,
11781178
mut secnonce: MusigSecNonce,
1179-
keypair: &KeyPair,
1179+
keypair: &Keypair,
11801180
key_agg_cache: &MusigKeyAggCache,
11811181
) -> Result<MusigPartialSignature, MusigSignError> {
11821182
unsafe {
@@ -1228,7 +1228,7 @@ impl MusigSession {
12281228
/// ```rust
12291229
/// # # [cfg(any(test, feature = "rand-std"))] {
12301230
/// # use secp256k1_zkp::rand::{thread_rng, RngCore};
1231-
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, KeyPair, PublicKey, MusigSessionId, Message, MusigAggNonce, MusigSession};
1231+
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, Keypair, PublicKey, MusigSessionId, Message, MusigAggNonce, MusigSession};
12321232
/// # let secp = Secp256k1::new();
12331233
/// # let sk1 = SecretKey::new(&mut thread_rng());
12341234
/// # let pub_key1 = PublicKey::from_secret_key(&secp, &sk1);
@@ -1238,7 +1238,7 @@ impl MusigSession {
12381238
/// # let key_agg_cache = MusigKeyAggCache::new(&secp, &[pub_key1, pub_key2]);
12391239
/// // The session id must be sampled at random. Read documentation for more details.
12401240
///
1241-
/// let msg = Message::from_slice(b"Public Message we want to sign!!").unwrap();
1241+
/// let msg = Message::from_digest_slice(b"Public Message we want to sign!!").unwrap();
12421242
///
12431243
/// // Provide the current time for mis-use resistance
12441244
/// let session_id1 = MusigSessionId::new(&mut thread_rng());
@@ -1259,7 +1259,7 @@ impl MusigSession {
12591259
/// msg,
12601260
/// );
12611261
///
1262-
/// let keypair = KeyPair::from_secret_key(&secp, &sk1);
1262+
/// let keypair = Keypair::from_secret_key(&secp, &sk1);
12631263
/// let partial_sig1 = session.partial_sign(
12641264
/// &secp,
12651265
/// sec_nonce1,
@@ -1311,7 +1311,7 @@ impl MusigSession {
13111311
/// ```rust
13121312
/// # # [cfg(any(test, feature = "rand-std"))] {
13131313
/// # use secp256k1_zkp::rand::{thread_rng, RngCore};
1314-
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, KeyPair, PublicKey, MusigSessionId, Message, MusigAggNonce, MusigSession};
1314+
/// # use secp256k1_zkp::{MusigKeyAggCache, Secp256k1, SecretKey, Keypair, PublicKey, MusigSessionId, Message, MusigAggNonce, MusigSession};
13151315
/// # let secp = Secp256k1::new();
13161316
/// # let sk1 = SecretKey::new(&mut thread_rng());
13171317
/// # let pub_key1 = PublicKey::from_secret_key(&secp, &sk1);
@@ -1321,7 +1321,7 @@ impl MusigSession {
13211321
/// let key_agg_cache = MusigKeyAggCache::new(&secp, &[pub_key1, pub_key2]);
13221322
/// // The session id must be sampled at random. Read documentation for more details.
13231323
///
1324-
/// let msg = Message::from_slice(b"Public Message we want to sign!!").unwrap();
1324+
/// let msg = Message::from_digest_slice(b"Public Message we want to sign!!").unwrap();
13251325
///
13261326
/// // Provide the current time for mis-use resistance
13271327
/// let session_id1 = MusigSessionId::new(&mut thread_rng());
@@ -1345,15 +1345,15 @@ impl MusigSession {
13451345
/// let partial_sig1 = session.partial_sign(
13461346
/// &secp,
13471347
/// sec_nonce1,
1348-
/// &KeyPair::from_secret_key(&secp, &sk1),
1348+
/// &Keypair::from_secret_key(&secp, &sk1),
13491349
/// &key_agg_cache,
13501350
/// ).unwrap();
13511351
///
13521352
/// // Other party creates the other partial signature
13531353
/// let partial_sig2 = session.partial_sign(
13541354
/// &secp,
13551355
/// sec_nonce2,
1356-
/// &KeyPair::from_secret_key(&secp, &sk2),
1356+
/// &Keypair::from_secret_key(&secp, &sk2),
13571357
/// &key_agg_cache,
13581358
/// ).unwrap();
13591359
///
@@ -1462,7 +1462,7 @@ mod tests {
14621462
let pub_key = PublicKey::from_secret_key(&secp, &sec_key);
14631463

14641464
let key_agg_cache = MusigKeyAggCache::new(&secp, &[pub_key, pub_key]);
1465-
let msg = Message::from_slice(&[3; 32]).unwrap();
1465+
let msg = Message::from_digest_slice(&[3; 32]).unwrap();
14661466
let session_id = MusigSessionId::assume_unique_per_nonce_gen([1; 32]);
14671467
let (_secnonce, pubnonce) = key_agg_cache
14681468
.nonce_gen(&secp, session_id, pub_key, msg, None)

0 commit comments

Comments
 (0)