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
They were only used for ensuring generated keys were globally
unique (ie in case the user opened the same seed at a different
time, we need generated keys to be globally unique).
Instead, we let the user specify a time in secs/nanos, and provide
a precise meaning for the user to understand.
// entropy, everything else just ensures uniqueness. We rely on the unique_start (ie
221
+
// starting_time provided in the constructor) to be unique.
222
+
letmut sha = self.unique_start.clone();
208
223
209
224
let child_ix = self.channel_child_index.fetch_add(1,Ordering::AcqRel);
210
225
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
226
sha.input(&child_privkey.private_key.key[..]);
212
227
213
-
seed = Sha256::from_engine(sha).into_inner();
228
+
letseed = Sha256::from_engine(sha).into_inner();
214
229
215
230
let commitment_seed = {
216
231
letmut sha = Sha256::engine();
@@ -244,11 +259,7 @@ impl KeysInterface for KeysManager {
244
259
}
245
260
246
261
fnget_session_key(&self) -> SecretKey{
247
-
letmut sha = Sha256::engine();
248
-
249
-
let now = SystemTime::now().duration_since(UNIX_EPOCH).expect("Time went backwards");
let child_ix = self.session_child_index.fetch_add(1,Ordering::AcqRel);
254
265
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");
@@ -257,11 +268,7 @@ impl KeysInterface for KeysManager {
257
268
}
258
269
259
270
fnget_channel_id(&self) -> [u8;32]{
260
-
letmut sha = Sha256::engine();
261
-
262
-
let now = SystemTime::now().duration_since(UNIX_EPOCH).expect("Time went backwards");
let child_ix = self.channel_id_child_index.fetch_add(1,Ordering::AcqRel);
267
274
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");
0 commit comments