mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 07:34:21 +01:00
struct secret: use everywhere.
We alternated between using a sha256 and using a privkey, but there are numerous places where we have a random 32 bytes which are neither. This fixes many of them (plus, struct privkey is now defined in terms of struct secret). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
#include "config.h"
|
||||
|
||||
struct pubkey;
|
||||
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 privkey *base_secret,
|
||||
bool derive_simple_privkey(const struct secret *base_secret,
|
||||
const struct pubkey *basepoint,
|
||||
const struct pubkey *per_commitment_point,
|
||||
struct privkey *key);
|
||||
@@ -19,8 +20,8 @@ bool derive_revocation_key(const struct pubkey *basepoint,
|
||||
const struct pubkey *per_commitment_point,
|
||||
struct pubkey *key);
|
||||
|
||||
bool derive_revocation_privkey(const struct privkey *base_secret,
|
||||
const struct privkey *per_commitment_secret,
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user