2017-08-28 18:06:01 +02:00
|
|
|
#ifndef LIGHTNING_COMMON_KEY_DERIVE_H
|
|
|
|
#define LIGHTNING_COMMON_KEY_DERIVE_H
|
2017-02-07 02:44:21 +01:00
|
|
|
#include "config.h"
|
2017-08-18 06:43:53 +02:00
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
#include <stdbool.h>
|
2017-02-07 02:44:21 +01:00
|
|
|
|
|
|
|
struct pubkey;
|
2017-08-18 06:43:53 +02:00
|
|
|
struct privkey;
|
2017-05-06 04:19:44 +02:00
|
|
|
struct secret;
|
2017-02-07 02:44:21 +01:00
|
|
|
|
|
|
|
/* For `localkey`, `remotekey`, `local-delayedkey` and `remote-delayedkey` */
|
|
|
|
bool derive_simple_key(const struct pubkey *basepoint,
|
|
|
|
const struct pubkey *per_commitment_point,
|
|
|
|
struct pubkey *key);
|
|
|
|
|
2017-05-06 04:19:44 +02:00
|
|
|
bool derive_simple_privkey(const struct secret *base_secret,
|
2017-02-07 02:44:21 +01:00
|
|
|
const struct pubkey *basepoint,
|
|
|
|
const struct pubkey *per_commitment_point,
|
|
|
|
struct privkey *key);
|
|
|
|
|
|
|
|
/* For `revocationkey` */
|
|
|
|
bool derive_revocation_key(const struct pubkey *basepoint,
|
|
|
|
const struct pubkey *per_commitment_point,
|
|
|
|
struct pubkey *key);
|
|
|
|
|
2017-05-06 04:19:44 +02:00
|
|
|
bool derive_revocation_privkey(const struct secret *base_secret,
|
|
|
|
const struct secret *per_commitment_secret,
|
2017-02-07 02:44:21 +01:00
|
|
|
const struct pubkey *basepoint,
|
|
|
|
const struct pubkey *per_commitment_point,
|
|
|
|
struct privkey *key);
|
|
|
|
|
2017-03-07 02:01:55 +01:00
|
|
|
|
|
|
|
struct ext_key;
|
|
|
|
bool bip32_pubkey(const struct ext_key *bip32_base,
|
|
|
|
struct pubkey *pubkey, u32 index);
|
2017-08-28 18:06:01 +02:00
|
|
|
#endif /* LIGHTNING_COMMON_KEY_DERIVE_H */
|