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 +979,8 @@ pub struct KeysManager {
979
979
channel_master_key:ExtendedPrivKey,
980
980
channel_child_index:AtomicUsize,
981
981
982
-
rand_bytes_master_key:ExtendedPrivKey,
983
-
rand_bytes_child_index:AtomicUsize,
984
-
rand_bytes_unique_start:Sha256State,
982
+
rand_bytes_unique_start:[u8;32],
983
+
rand_bytes_index:AtomicUsize,
985
984
986
985
seed:[u8;32],
987
986
starting_time_secs:u64,
@@ -1027,15 +1026,13 @@ impl KeysManager {
1027
1026
Err(_) => panic!("Your RNG is busted"),
1028
1027
};
1029
1028
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
1029
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()
1247
+
let index = self.rand_bytes_index.fetch_add(1,Ordering::AcqRel);
0 commit comments