mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 07:17:40 +01:00
Make derive_private_key public
This commit is contained in:
parent
06445b6189
commit
4f84b05d31
1 changed files with 3 additions and 2 deletions
|
@ -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<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());
|
||||
|
|
Loading…
Add table
Reference in a new issue