From 4f84b05d31eb9725a648b6e65ef5a68bd59eb05b Mon Sep 17 00:00:00 2001 From: Antoine Riard Date: Tue, 5 May 2020 18:36:06 -0400 Subject: [PATCH] Make derive_private_key public --- lightning/src/ln/chan_utils.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lightning/src/ln/chan_utils.rs b/lightning/src/ln/chan_utils.rs index e619716a..f4baf668 100644 --- 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) -pub(crate) fn derive_private_key(secp_ctx: &Secp256k1, per_commitment_point: &PublicKey, base_secret: &SecretKey) -> Result { +pub fn derive_private_key(secp_ctx: &Secp256k1, per_commitment_point: &PublicKey, base_secret: &SecretKey) -> Result { let mut sha = Sha256::engine(); sha.input(&per_commitment_point.serialize()); sha.input(&PublicKey::from_secret_key(&secp_ctx, &base_secret).serialize()); -- 2.30.2