projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
06445b6
)
Make derive_private_key public
author
Antoine Riard
<ariard@student.42.fr>
Tue, 5 May 2020 22:36:06 +0000
(18:36 -0400)
committer
Antoine Riard
<ariard@student.42.fr>
Thu, 28 May 2020 08:21:47 +0000
(
04:21
-0400)
lightning/src/ln/chan_utils.rs
patch
|
blob
|
history
diff --git
a/lightning/src/ln/chan_utils.rs
b/lightning/src/ln/chan_utils.rs
index e619716a3cc8cfea5cd4c4688da6f5dad5056729..f4baf668f5651a4a62690ffe583a9a36b5a54176 100644
(file)
--- a/
lightning/src/ln/chan_utils.rs
+++ b/
lightning/src/ln/chan_utils.rs
@@
-171,9
+171,10
@@
impl Readable for CounterpartyCommitmentSecrets {
}
}
}
}
-/// Derives a per-commitment-transaction private key (eg an htlc key or payment key) from the base
+/// Derives a per-commitment-transaction private key (eg an htlc key, payment key or delayed_payment
+/// key) from the base.
/// private key for that type of key and the per_commitment_point (available in TxCreationKeys)
/// private key for that type of key and the per_commitment_point (available in TxCreationKeys)
-pub
(crate)
fn derive_private_key<T: secp256k1::Signing>(secp_ctx: &Secp256k1<T>, per_commitment_point: &PublicKey, base_secret: &SecretKey) -> Result<SecretKey, secp256k1::Error> {
+pub fn derive_private_key<T: secp256k1::Signing>(secp_ctx: &Secp256k1<T>, per_commitment_point: &PublicKey, base_secret: &SecretKey) -> Result<SecretKey, secp256k1::Error> {
let mut sha = Sha256::engine();
sha.input(&per_commitment_point.serialize());
sha.input(&PublicKey::from_secret_key(&secp_ctx, &base_secret).serialize());
let mut sha = Sha256::engine();
sha.input(&per_commitment_point.serialize());
sha.input(&PublicKey::from_secret_key(&secp_ctx, &base_secret).serialize());