mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 08:34:20 +01:00
lightningd/opening: seed is a privkey not an sha256.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -64,7 +64,7 @@ struct state {
|
|||||||
struct channel *channel;
|
struct channel *channel;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void derive_our_basepoints(const struct sha256 *seed,
|
static void derive_our_basepoints(const struct privkey *seed,
|
||||||
struct points *points,
|
struct points *points,
|
||||||
struct secrets *secrets,
|
struct secrets *secrets,
|
||||||
struct sha256 *shaseed,
|
struct sha256 *shaseed,
|
||||||
@@ -76,7 +76,7 @@ static void derive_our_basepoints(const struct sha256 *seed,
|
|||||||
struct sha256 shaseed;
|
struct sha256 shaseed;
|
||||||
} keys;
|
} keys;
|
||||||
|
|
||||||
hkdf_sha256(&keys, sizeof(keys), NULL, 0, seed, sizeof(seed),
|
hkdf_sha256(&keys, sizeof(keys), NULL, 0, seed, sizeof(*seed),
|
||||||
"c-lightning", strlen("c-lightning"));
|
"c-lightning", strlen("c-lightning"));
|
||||||
|
|
||||||
secrets->funding_privkey = keys.f;
|
secrets->funding_privkey = keys.f;
|
||||||
@@ -90,7 +90,7 @@ static void derive_our_basepoints(const struct sha256 *seed,
|
|||||||
|| !pubkey_from_privkey(&keys.d, &points->delayed_payment_basepoint))
|
|| !pubkey_from_privkey(&keys.d, &points->delayed_payment_basepoint))
|
||||||
status_failed(WIRE_OPENING_KEY_DERIVATION_FAILED,
|
status_failed(WIRE_OPENING_KEY_DERIVATION_FAILED,
|
||||||
"seed = %s",
|
"seed = %s",
|
||||||
type_to_string(trc, struct sha256, seed));
|
type_to_string(trc, struct privkey, seed));
|
||||||
|
|
||||||
/* BOLT #3:
|
/* BOLT #3:
|
||||||
*
|
*
|
||||||
@@ -593,7 +593,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
u8 *msg, *peer_msg;
|
u8 *msg, *peer_msg;
|
||||||
struct state *state = tal(NULL, struct state);
|
struct state *state = tal(NULL, struct state);
|
||||||
struct sha256 seed;
|
struct privkey seed;
|
||||||
struct points our_points;
|
struct points our_points;
|
||||||
|
|
||||||
if (argc == 2 && streq(argv[1], "--version")) {
|
if (argc == 2 && streq(argv[1], "--version")) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ opening_init,36,min_config,36,struct channel_config
|
|||||||
opening_init,72,max_config,36,struct channel_config
|
opening_init,72,max_config,36,struct channel_config
|
||||||
opening_init,108,crypto_state,144,struct crypto_state
|
opening_init,108,crypto_state,144,struct crypto_state
|
||||||
# Seed to generate all the keys from
|
# Seed to generate all the keys from
|
||||||
opening_init,252,seed,32
|
opening_init,252,seed,32,struct privkey
|
||||||
|
|
||||||
# This means we offer the open.
|
# This means we offer the open.
|
||||||
opening_open,1
|
opening_open,1
|
||||||
|
|||||||
|
Reference in New Issue
Block a user