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
/// Used as initial key material, to be expanded into multiple secret keys (but not to be used
@@ -979,9 +980,8 @@ pub struct KeysManager {
979
980
channel_master_key:ExtendedPrivKey,
980
981
channel_child_index:AtomicUsize,
981
982
982
-
rand_bytes_master_key:ExtendedPrivKey,
983
-
rand_bytes_child_index:AtomicUsize,
984
-
rand_bytes_unique_start:Sha256State,
983
+
rand_bytes_unique_start:[u8;32],
984
+
rand_bytes_index:AtomicCounter,
985
985
986
986
seed:[u8;32],
987
987
starting_time_secs:u64,
@@ -1027,15 +1027,16 @@ impl KeysManager {
1027
1027
Err(_) => panic!("Your RNG is busted"),
1028
1028
};
1029
1029
let channel_master_key = master_key.ckd_priv(&secp_ctx,ChildNumber::from_hardened_idx(3).unwrap()).expect("Your RNG is busted");
1030
-
let rand_bytes_master_key = master_key.ckd_priv(&secp_ctx,ChildNumber::from_hardened_idx(4).unwrap()).expect("Your RNG is busted");
1031
1030
let inbound_payment_key:SecretKey = master_key.ckd_priv(&secp_ctx,ChildNumber::from_hardened_idx(5).unwrap()).expect("Your RNG is busted").private_key;
let child_ix = self.rand_bytes_child_index.fetch_add(1,Ordering::AcqRel);
1254
-
let child_privkey = self.rand_bytes_master_key.ckd_priv(&self.secp_ctx,ChildNumber::from_hardened_idx(child_ix asu32).expect("key space exhausted")).expect("Your RNG is busted");
1255
-
sha.input(&child_privkey.private_key[..]);
1256
-
1257
-
sha.input(b"Unique Secure Random Bytes Salt");
1258
-
Sha256::from_engine(sha).into_inner()
1251
+
let index = self.rand_bytes_index.get_increment();
0 commit comments