@@ -13,9 +13,8 @@ use alloc::string::ToString;
1313use  bitcoin:: hashes:: { Hash ,  HashEngine } ; 
1414use  bitcoin:: hashes:: cmp:: fixed_time_eq; 
1515use  bitcoin:: hashes:: hmac:: { Hmac ,  HmacEngine } ; 
16- use  bitcoin:: hashes:: sha256:: Hash  as  Sha256 ; 
16+ use  bitcoin:: hashes:: sha256:: { Hash  as  Sha256 ,   self } ; 
1717use  bitcoin:: secp256k1:: { PublicKey ,  Secp256k1 ,  SecretKey } ; 
18- use  bitcoin:: secp256k1:: scalar:: Scalar ; 
1918use  crate :: chain:: keysinterface:: { KeyMaterial ,  EntropySource } ; 
2019use  crate :: ln:: { PaymentHash ,  PaymentPreimage ,  PaymentSecret } ; 
2120use  crate :: ln:: msgs; 
@@ -79,15 +78,13 @@ impl ExpandedKey {
7978 	/// 
8079 	/// [`Offer::signing_pubkey`]: crate::offers::offer::Offer::signing_pubkey 
8180 	pub ( crate )  fn  signing_pubkey_for_offer ( & self ,  nonce :  Nonce )  -> PublicKey  { 
81+ 		let  mut  engine = sha256:: Hash :: engine ( ) ; 
82+ 		engine. input ( & self . ldk_pmt_hash_key ) ; 
83+ 		engine. input ( & nonce. 0 ) ; 
84+ 
85+ 		let  hash = sha256:: Hash :: from_engine ( engine) ; 
8286		let  secp_ctx = Secp256k1 :: new ( ) ; 
83- 		let  mut  tweak = [ 0 ;  32 ] ; 
84- 		tweak[ ..Nonce :: LENGTH ] . copy_from_slice ( & nonce. 0 ) ; 
85- 
86- 		SecretKey :: from_slice ( & self . ldk_pmt_hash_key ) 
87- 			. unwrap ( ) 
88- 			. mul_tweak ( & Scalar :: from_be_bytes ( tweak) . unwrap ( ) ) 
89- 			. unwrap ( ) 
90- 			. public_key ( & secp_ctx) 
87+ 		SecretKey :: from_slice ( & hash) . unwrap ( ) . public_key ( & secp_ctx) 
9188	} 
9289} 
9390
0 commit comments