mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
c938ebb5c0
This repairs make check. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
20 lines
468 B
C
20 lines
468 B
C
#include "utils.h"
|
|
#include <ccan/str/hex/hex.h>
|
|
|
|
secp256k1_context *secp256k1_ctx;
|
|
|
|
char *tal_hexstr(const tal_t *ctx, const void *data, size_t len)
|
|
{
|
|
char *str = tal_arr(ctx, char, hex_str_size(len));
|
|
hex_encode(data, len, str, hex_str_size(len));
|
|
return str;
|
|
}
|
|
|
|
u8 *tal_hexdata(const tal_t *ctx, const void *str, size_t len)
|
|
{
|
|
u8 *data = tal_arr(ctx, u8, hex_data_size(len));
|
|
if (!hex_decode(str, len, data, hex_data_size(len)))
|
|
return NULL;
|
|
return data;
|
|
}
|