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 witness_script = bitcoin::Address::p2pkh(&::bitcoin::PublicKey{compressed:true,inner: remotepubkey},Network::Testnet).script_pubkey();
688
715
let sighash = hash_to_message!(&sighash::SighashCache::new(spend_tx).segwit_signature_hash(input_idx,&witness_script, descriptor.output.value,EcdsaSighashType::All).unwrap()[..]);
689
-
let remotesig = sign(secp_ctx,&sighash,&self.payment_key);
716
+
let remotesig = sign_with_aux_rand(secp_ctx,&sighash,&self.payment_key,&self);
690
717
let payment_script = bitcoin::Address::p2wpkh(&::bitcoin::PublicKey{compressed:true,inner: remotepubkey},Network::Bitcoin).unwrap().script_pubkey();
691
718
692
719
if payment_script != descriptor.output.script_pubkey{returnErr(());}
@@ -722,7 +749,7 @@ impl InMemorySigner {
722
749
let delayed_payment_pubkey = PublicKey::from_secret_key(&secp_ctx,&delayed_payment_key);
723
750
let witness_script = chan_utils::get_revokeable_redeemscript(&descriptor.revocation_pubkey, descriptor.to_self_delay,&delayed_payment_pubkey);
724
751
let sighash = hash_to_message!(&sighash::SighashCache::new(spend_tx).segwit_signature_hash(input_idx,&witness_script, descriptor.output.value,EcdsaSighashType::All).unwrap()[..]);
725
-
let local_delayedsig = sign(secp_ctx,&sighash,&delayed_payment_key);
752
+
let local_delayedsig = sign_with_aux_rand(secp_ctx,&sighash,&delayed_payment_key,&self);
726
753
let payment_script = bitcoin::Address::p2wsh(&witness_script,Network::Bitcoin).script_pubkey();
727
754
728
755
if descriptor.output.script_pubkey != payment_script {returnErr(());}
@@ -736,6 +763,15 @@ impl InMemorySigner {
736
763
}
737
764
}
738
765
766
+
implEntropySourceforInMemorySigner{
767
+
fnget_secure_random_bytes(&self) -> [u8;32]{
768
+
let index = self.rand_bytes_index.get_increment();
@@ -869,7 +905,7 @@ impl EcdsaChannelSigner for InMemorySigner {
869
905
let witness_script = chan_utils::get_htlc_redeemscript_with_explicit_keys(&htlc,self.opt_anchors(),&counterparty_htlcpubkey,&htlcpubkey,&revocation_pubkey);
let payment_key = key_step!(b"payment key", revocation_base_key);
1108
1146
let delayed_payment_base_key = key_step!(b"delayed payment base key", payment_key);
1109
1147
let htlc_base_key = key_step!(b"HTLC base key", delayed_payment_base_key);
1148
+
let prng_seed = self.get_secure_random_bytes();
1110
1149
1111
1150
InMemorySigner::new(
1112
1151
&self.secp_ctx,
@@ -1118,6 +1157,7 @@ impl KeysManager {
1118
1157
commitment_seed,
1119
1158
channel_value_satoshis,
1120
1159
params.clone(),
1160
+
prng_seed,
1121
1161
)
1122
1162
}
1123
1163
@@ -1233,7 +1273,7 @@ impl KeysManager {
1233
1273
if payment_script != output.script_pubkey{returnErr(());};
1234
1274
1235
1275
let sighash = hash_to_message!(&sighash::SighashCache::new(&spend_tx).segwit_signature_hash(input_idx,&witness_script, output.value,EcdsaSighashType::All).unwrap()[..]);
1236
-
let sig = sign(secp_ctx,&sighash,&secret.private_key);
1276
+
let sig = sign_with_aux_rand(secp_ctx,&sighash,&secret.private_key,&self);
1237
1277
letmut sig_ser = sig.serialize_der().to_vec();
1238
1278
sig_ser.push(EcdsaSighashType::Allasu8);
1239
1279
spend_tx.input[input_idx].witness.push(sig_ser);
@@ -1295,7 +1335,7 @@ impl NodeSigner for KeysManager {
0 commit comments