1- use bitcoin:: hashes:: { Hash , HashEngine } ;
21use bitcoin:: hashes:: hmac:: { Hmac , HmacEngine } ;
32use bitcoin:: hashes:: sha256:: Hash as Sha256 ;
4- use bitcoin:: secp256k1:: { Message , Secp256k1 , SecretKey , ecdsa:: Signature , Signing } ;
3+ use bitcoin:: hashes:: { Hash , HashEngine } ;
4+ use bitcoin:: secp256k1:: { ecdsa:: Signature , Message , Secp256k1 , SecretKey , Signing } ;
55
66use crate :: sign:: EntropySource ;
77
@@ -43,14 +43,16 @@ macro_rules! hkdf_extract_expand {
4343 let k5 = Hmac :: from_engine( hmac) . to_byte_array( ) ;
4444
4545 ( k1, k2, k3, k4, k5)
46- } }
46+ } } ;
4747}
4848
4949pub fn hkdf_extract_expand_twice ( salt : & [ u8 ] , ikm : & [ u8 ] ) -> ( [ u8 ; 32 ] , [ u8 ; 32 ] ) {
5050 hkdf_extract_expand ! ( salt, ikm, 2 )
5151}
5252
53- pub fn hkdf_extract_expand_5x ( salt : & [ u8 ] , ikm : & [ u8 ] ) -> ( [ u8 ; 32 ] , [ u8 ; 32 ] , [ u8 ; 32 ] , [ u8 ; 32 ] , [ u8 ; 32 ] ) {
53+ pub fn hkdf_extract_expand_5x (
54+ salt : & [ u8 ] , ikm : & [ u8 ] ,
55+ ) -> ( [ u8 ; 32 ] , [ u8 ; 32 ] , [ u8 ; 32 ] , [ u8 ; 32 ] , [ u8 ; 32 ] ) {
5456 hkdf_extract_expand ! ( salt, ikm, 5 )
5557}
5658
@@ -66,8 +68,11 @@ pub fn sign<C: Signing>(ctx: &Secp256k1<C>, msg: &Message, sk: &SecretKey) -> Si
6668#[ inline]
6769#[ allow( unused_variables) ]
6870pub fn sign_with_aux_rand < C : Signing , ES : Deref > (
69- ctx : & Secp256k1 < C > , msg : & Message , sk : & SecretKey , entropy_source : & ES
70- ) -> Signature where ES :: Target : EntropySource {
71+ ctx : & Secp256k1 < C > , msg : & Message , sk : & SecretKey , entropy_source : & ES ,
72+ ) -> Signature
73+ where
74+ ES :: Target : EntropySource ,
75+ {
7176 #[ cfg( feature = "grind_signatures" ) ]
7277 let sig = loop {
7378 let sig = ctx. sign_ecdsa_with_noncedata ( msg, sk, & entropy_source. get_secure_random_bytes ( ) ) ;
0 commit comments