core-lightning/common/ecdh_hsmd.h
Rusty Russell 3b4a06f52b common: generalize ecdh function.
common/onion is going to need to use this for the case where it finds a blinding
seed inside the TLV.  But how it does ecdh is daemon-specific.

We already had this problem for devtools/gossipwith, which supplied a
special hsm_do_ecdh().  This just makes it more general.

So we create a generic ecdh() interface, with a specific implementation
which subdaemons and lightningd can use.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-04-04 16:08:49 +10:30

14 lines
405 B
C

#ifndef LIGHTNING_COMMON_ECDH_HSMD_H
#define LIGHTNING_COMMON_ECDH_HSMD_H
#include "config.h"
#include <common/ecdh.h>
#include <common/status_levels.h>
/* The via-the-hsmd implementation of ecdh(). */
/* You must call this before calling ecdh(). */
void ecdh_hsmd_setup(int hsm_fd,
void (*failed)(enum status_failreason,
const char *fmt, ...));
#endif /* LIGHTNING_COMMON_ECDH_HSMD_H */