forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
key_derive.h
36 lines (29 loc) · 1.13 KB
/
key_derive.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef LIGHTNING_COMMON_KEY_DERIVE_H
#define LIGHTNING_COMMON_KEY_DERIVE_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <stdbool.h>
struct pubkey;
struct privkey;
struct secret;
/* 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);
bool derive_simple_privkey(const struct secret *base_secret,
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);
bool derive_revocation_privkey(const struct secret *base_secret,
const struct secret *per_commitment_secret,
const struct pubkey *basepoint,
const struct pubkey *per_commitment_point,
struct privkey *key);
struct ext_key;
bool bip32_pubkey(const struct ext_key *bip32_base,
struct pubkey *pubkey, u32 index);
#endif /* LIGHTNING_COMMON_KEY_DERIVE_H */