You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let child_ix = self.channel_child_index.fetch_add(1,Ordering::AcqRel);
210
-
let child_privkey = self.channel_master_key.ckd_priv(&self.secp_ctx,ChildNumber::from_hardened_idx(child_ix asu32)).expect("Your RNG is busted");
211
-
sha.input(&child_privkey.secret_key[..]);
210
+
let child_privkey = self.channel_master_key.ckd_priv(&self.secp_ctx,ChildNumber::from_hardened_idx(child_ix asu32).expect("key space exhausted")).expect("Your RNG is busted");
211
+
sha.input(&child_privkey.private_key.key[..]);
212
212
213
213
seed = Sha256::from_engine(sha).into_inner();
214
214
@@ -251,8 +251,8 @@ impl KeysInterface for KeysManager {
let child_ix = self.session_child_index.fetch_add(1,Ordering::AcqRel);
254
-
let child_privkey = self.session_master_key.ckd_priv(&self.secp_ctx,ChildNumber::from_hardened_idx(child_ix asu32)).expect("Your RNG is busted");
255
-
sha.input(&child_privkey.secret_key[..]);
254
+
let child_privkey = self.session_master_key.ckd_priv(&self.secp_ctx,ChildNumber::from_hardened_idx(child_ix asu32).expect("key space exhausted")).expect("Your RNG is busted");
255
+
sha.input(&child_privkey.private_key.key[..]);
256
256
SecretKey::from_slice(&Sha256::from_engine(sha).into_inner()).expect("Your RNG is busted")
257
257
}
258
258
@@ -264,8 +264,8 @@ impl KeysInterface for KeysManager {
let child_ix = self.channel_id_child_index.fetch_add(1,Ordering::AcqRel);
267
-
let child_privkey = self.channel_id_master_key.ckd_priv(&self.secp_ctx,ChildNumber::from_hardened_idx(child_ix asu32)).expect("Your RNG is busted");
268
-
sha.input(&child_privkey.secret_key[..]);
267
+
let child_privkey = self.channel_id_master_key.ckd_priv(&self.secp_ctx,ChildNumber::from_hardened_idx(child_ix asu32).expect("key space exhausted")).expect("Your RNG is busted");
use ln::channelmanager::{HTLCSource,PaymentPreimage,PaymentHash};
3965
3966
use ln::channel::{Channel,ChannelKeys,InboundHTLCOutput,OutboundHTLCOutput,InboundHTLCState,OutboundHTLCState,HTLCOutputInCommitment,TxCreationKeys};
@@ -3974,6 +3975,8 @@ mod tests {
3974
3975
use secp256k1::{Secp256k1,Message,Signature};
3975
3976
use secp256k1::key::{SecretKey,PublicKey};
3976
3977
use bitcoin_hashes::sha256::HashasSha256;
3978
+
use bitcoin_hashes::sha256d::HashasSha256dHash;
3979
+
use bitcoin_hashes::hash160::HashasHash160;
3977
3980
use bitcoin_hashes::Hash;
3978
3981
use std::sync::Arc;
3979
3982
@@ -4000,7 +4003,7 @@ mod tests {
4000
4003
fnget_destination_script(&self) -> Script{
4001
4004
let secp_ctx = Secp256k1::signing_only();
4002
4005
let channel_monitor_claim_key = SecretKey::from_slice(&hex::decode("0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap()[..]).unwrap();
4003
-
let our_channel_monitor_claim_key_hash = Hash160::from_data(&PublicKey::from_secret_key(&secp_ctx,&channel_monitor_claim_key).serialize());
4006
+
let our_channel_monitor_claim_key_hash = Hash160::hash(&PublicKey::from_secret_key(&secp_ctx,&channel_monitor_claim_key).serialize());
0 commit comments